Documentation
¶
Index ¶
Constants ¶
View Source
const SensitiveAnnotationKey = "sensitive"
SensitiveAnnotationKey is the pflag annotation key used to mark flags whose values contain secrets (cryptographic keys, tokens, etc.) and must not appear in logs or process listings.
Variables ¶
This section is empty.
Functions ¶
func ProcessEmbeddedDocs ¶
Types ¶
type CommandOpts ¶
type CommandOpts func(d *Doc)
func WithHiddenFlags ¶
func WithHiddenFlags(flags ...string) CommandOpts
Hide any global or persisent flags from parent commands on the given command
func WithSubcommands ¶
func WithSubcommands(subCmds ...*Doc) CommandOpts
type Doc ¶
func ProcessDoc ¶
func (*Doc) AddSubcommands ¶
func (*Doc) GetDocFlag ¶
func (*Doc) MarkSensitiveFlags ¶ added in v0.32.0
func (d *Doc) MarkSensitiveFlags()
MarkSensitiveFlags sets pflag annotations on all flags in the command's FlagSet that are marked sensitive in the doc metadata. Call after all flags have been registered.
type DocFlag ¶
type DocFlag struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Shorthand string `yaml:"shorthand"`
Default string `yaml:"default"`
Enum []string `yaml:"enum"`
Sensitive bool `yaml:"sensitive"`
}
func (DocFlag) DefaultAsBool ¶
Click to show internal directories.
Click to hide internal directories.