diff --git a/cmd/notation/common.go b/cmd/notation/common.go index 9d19890fb..392130421 100644 --- a/cmd/notation/common.go +++ b/cmd/notation/common.go @@ -16,7 +16,7 @@ var ( flagUsername = &pflag.Flag{ Name: "username", Shorthand: "u", - Usage: "Username for registry operations (default from $NOTATION_USERNAME)", + Usage: "username for registry operations (if not specified, defaults to $NOTATION_USERNAME)", } setflagUsername = func(fs *pflag.FlagSet, p *string) { fs.StringVarP(p, flagUsername.Name, flagUsername.Shorthand, "", flagUsername.Usage) @@ -25,7 +25,7 @@ var ( flagPassword = &pflag.Flag{ Name: "password", Shorthand: "p", - Usage: "Password for registry operations (default from $NOTATION_PASSWORD)", + Usage: "password for registry operations (if not specified, defaults to $NOTATION_PASSWORD)", } setFlagPassword = func(fs *pflag.FlagSet, p *string) { fs.StringVarP(p, flagPassword.Name, flagPassword.Shorthand, "", flagPassword.Usage) diff --git a/cmd/notation/sign.go b/cmd/notation/sign.go index 74c6b175f..9f72f4170 100644 --- a/cmd/notation/sign.go +++ b/cmd/notation/sign.go @@ -34,7 +34,26 @@ func signCommand(opts *signOpts) *cobra.Command { } command := &cobra.Command{ Use: "sign [reference]", - Short: "Signs artifacts", + Short: "Sign OCI artifacts", + Long: `Sign OCI artifacts + +Prerequisite: a signing key needs to be configured using the command "notation key". + +Example - Sign a container image using the default signing key, with the default JWS envelope: + notation sign /: + +Example - Sign a container image using the default signing key, with the COSE envelope: + notation sign --envelope-type cose /: + +Example - Sign a container image using the specified key name + notation sign --key /: + +Example - Sign a container image using a local testing key and certificate file directly + notation sign --key-file --cert-file /: + +Example - Sign a container image using the image digest + notation sign /@ +`, Args: func(cmd *cobra.Command, args []string) error { if len(args) == 0 { return errors.New("missing reference") diff --git a/cmd/notation/verify.go b/cmd/notation/verify.go index 70dc1fbea..367c02b38 100644 --- a/cmd/notation/verify.go +++ b/cmd/notation/verify.go @@ -34,7 +34,20 @@ func verifyCommand(opts *verifyOpts) *cobra.Command { } command := &cobra.Command{ Use: "verify [reference]", - Short: "Verifies OCI Artifacts", + Short: "Verify OCI artifacts", + Long: `Verify OCI artifacts + +Prerequisite: a trusted certificate needs to be generated or added using the command "notation cert". + +Example - Verify a signature using the trusted certificate: + notation verify /: + +Example - Verify a signature associated with an OCI artifact identified by the digest: + notation verify /@ + +Example - Verify a signature using a trusted certificate in a specified path: + notation verify --cert-file /: +`, Args: func(cmd *cobra.Command, args []string) error { if len(args) == 0 { return errors.New("missing reference")