Skip to content

Commit

Permalink
Generate CLI docs.
Browse files Browse the repository at this point in the history
Signed-off-by: Billy Lynch <billy@chainguard.dev>
  • Loading branch information
wlynch committed Nov 17, 2022
1 parent a8a5f24 commit 842da45
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 4 deletions.
28 changes: 28 additions & 0 deletions docs/cli/gitsign.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## gitsign

Keyless Git signing with Sigstore!

```
gitsign [flags]
```

### Options

```
-a, --armor create ascii armored output
-b, --detached-sign make a detached signature
-h, --help help for gitsign
--include-certs int -3 is the same as -2, but ommits issuer when cert has Authority Information Access extension. -2 includes all certs except root. -1 includes all certs. 0 includes no certs. 1 includes leaf cert. >1 includes n from the leaf. Default -2. (default -2)
-u, --local-user string use USER-ID to sign
-s, --sign make a signature
--status-fd int write special status strings to the file descriptor n. (default -1)
-v, --verify verify a signature
--version print Gitsign version
```

### SEE ALSO

* [gitsign show](gitsign_show.md) - Show source predicate information
* [gitsign version](gitsign_version.md) - print Gitsign version

###### Auto generated by spf13/cobra on 17-Nov-2022
29 changes: 29 additions & 0 deletions docs/cli/gitsign_show.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## gitsign show

Show source predicate information

### Synopsis

Show source predicate information

Prints an in-toto style predicate for the specified revision.
If no revision is specified, HEAD is used.

This command is experimental, and its CLI surface may change.

```
gitsign show [revision] [flags]
```

### Options

```
-h, --help help for show
-r, --remote string git remote (used to populate subject) (default "origin")
```

### SEE ALSO

* [gitsign](gitsign.md) - Keyless Git signing with Sigstore!

###### Auto generated by spf13/cobra on 17-Nov-2022
19 changes: 19 additions & 0 deletions docs/cli/gitsign_version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## gitsign version

print Gitsign version

```
gitsign version [flags]
```

### Options

```
-h, --help help for version
```

### SEE ALSO

* [gitsign](gitsign.md) - Keyless Git signing with Sigstore!

###### Auto generated by spf13/cobra on 17-Nov-2022
30 changes: 30 additions & 0 deletions docs/cli/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2022 The Sigstore Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:generate go run .
package main

import (
"log"

"github.com/sigstore/gitsign/internal/commands/root"
"github.com/spf13/cobra/doc"
)

func main() {
err := doc.GenMarkdownTree(root.New(nil), ".")
if err != nil {
log.Fatal(err)
}
}
4 changes: 4 additions & 0 deletions internal/commands/root/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ package root
import (
"github.com/spf13/cobra"

"github.com/sigstore/gitsign/internal/commands/show"
"github.com/sigstore/gitsign/internal/commands/version"
"github.com/sigstore/gitsign/internal/config"
"github.com/sigstore/gitsign/internal/io"
)
Expand Down Expand Up @@ -78,6 +80,8 @@ func New(cfg *config.Config) *cobra.Command {
},
}

rootCmd.AddCommand(version.New(cfg))
rootCmd.AddCommand(show.New(cfg))
o.AddFlags(rootCmd)

return rootCmd
Expand Down
4 changes: 0 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import (
// Enable OIDC providers
_ "github.com/sigstore/cosign/pkg/providers/all"
"github.com/sigstore/gitsign/internal/commands/root"
"github.com/sigstore/gitsign/internal/commands/show"
"github.com/sigstore/gitsign/internal/commands/version"
"github.com/sigstore/gitsign/internal/config"
)

Expand All @@ -35,8 +33,6 @@ func main() {
}

rootCmd := root.New(cfg)
rootCmd.AddCommand(version.New(cfg))
rootCmd.AddCommand(show.New(cfg))

if err := rootCmd.Execute(); err != nil {
os.Exit(1)
Expand Down

0 comments on commit 842da45

Please sign in to comment.