Documentation
¶
Overview ¶
Package cmd contains common flags and routines for all CLIs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PflagKey = &pflag.Flag{ Name: "key", Shorthand: "k", Usage: "signing key name, for a key previously added to notation's key list.", } SetPflagKey = func(fs *pflag.FlagSet, p *string) { fs.StringVarP(p, PflagKey.Name, PflagKey.Shorthand, "", PflagKey.Usage) } PflagSignatureFormat = &pflag.Flag{ Name: "signature-format", Usage: "signature envelope format, options: 'jws', 'cose'", } SetPflagSignatureFormat = func(fs *pflag.FlagSet, p *string) { defaultSignatureFormat := envelope.JWS config, err := configutil.LoadConfigOnce() if err == nil && config.SignatureFormat != "" { defaultSignatureFormat = config.SignatureFormat } fs.StringVar(p, PflagSignatureFormat.Name, defaultSignatureFormat, PflagSignatureFormat.Usage) } PflagTimestamp = &pflag.Flag{ Name: "timestamp", Shorthand: "t", Usage: "timestamp the signed signature via the remote TSA", } SetPflagTimestamp = func(fs *pflag.FlagSet, p *string) { fs.StringVarP(p, PflagTimestamp.Name, PflagTimestamp.Shorthand, "", PflagTimestamp.Usage) } PflagExpiry = &pflag.Flag{ Name: "expiry", Shorthand: "e", Usage: "optional expiry that provides a \"best by use\" time for the artifact. The duration is specified in minutes(m) and/or hours(h). For example: 12h, 30m, 3h20m", } SetPflagExpiry = func(fs *pflag.FlagSet, p *time.Duration) { fs.DurationVarP(p, PflagExpiry.Name, PflagExpiry.Shorthand, time.Duration(0), PflagExpiry.Usage) } PflagReference = &pflag.Flag{ Name: "reference", Shorthand: "r", Usage: "original reference", } SetPflagReference = func(fs *pflag.FlagSet, p *string) { fs.StringVarP(p, PflagReference.Name, PflagReference.Shorthand, "", PflagReference.Usage) } PflagPluginConfig = &pflag.Flag{ Name: "plugin-config", Shorthand: "c", Usage: "{key}={value} pairs that are passed as it is to a plugin, refer plugin's documentation to set appropriate values", } SetPflagPluginConfig = func(fs *pflag.FlagSet, p *[]string) { fs.StringArrayVarP(p, PflagPluginConfig.Name, PflagPluginConfig.Shorthand, nil, PflagPluginConfig.Usage) } )
Functions ¶
Types ¶
type KeyValueSlice ¶
KeyValueSlice is a flag with type int
type SignerFlagOpts ¶
SignerFlagOpts cmd opts for using cmd.GetSigner
func (*SignerFlagOpts) ApplyFlags ¶
func (opts *SignerFlagOpts) ApplyFlags(fs *pflag.FlagSet)
ApplyFlags set flags and their default values for the FlagSet
Click to show internal directories.
Click to hide internal directories.