diff --git a/docs/cli/gitsign.md b/docs/cli/gitsign.md new file mode 100644 index 00000000..edadd94d --- /dev/null +++ b/docs/cli/gitsign.md @@ -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 diff --git a/docs/cli/gitsign_show.md b/docs/cli/gitsign_show.md new file mode 100644 index 00000000..ffa868cd --- /dev/null +++ b/docs/cli/gitsign_show.md @@ -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 diff --git a/docs/cli/gitsign_version.md b/docs/cli/gitsign_version.md new file mode 100644 index 00000000..4323ee6d --- /dev/null +++ b/docs/cli/gitsign_version.md @@ -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 diff --git a/docs/cli/main.go b/docs/cli/main.go new file mode 100644 index 00000000..8ff65abc --- /dev/null +++ b/docs/cli/main.go @@ -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) + } +} diff --git a/internal/commands/root/root.go b/internal/commands/root/root.go index 411206b0..2c1257a9 100644 --- a/internal/commands/root/root.go +++ b/internal/commands/root/root.go @@ -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" ) @@ -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 diff --git a/main.go b/main.go index 5b0d5688..dd80857f 100644 --- a/main.go +++ b/main.go @@ -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" ) @@ -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)