Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAvailableCommand ¶
IsAvailableCommand determines if a command is available as a non-help command (this includes all non hidden commands). Slightly modified version of https://pkg.go.dev/github.com/spf13/cobra#Command.IsAvailableCommand to work around https://github.com/spf13/cobra/issues/2032, and make it so deprecated commands are rendered
Types ¶
type ChildCommand ¶
type Command ¶
type Command struct { Name string Short string Long string Example string Deprecated string Use string NonInheritedFlags Flags InheritedFlags Flags HasSeeAlso bool Parent *ParentCommand Children []ChildCommand }
Command contains the single *cobra.Command's documentation and any relevant fields for documentation
func (Command) IsDeprecated ¶
type CommandDoc ¶
CommandDoc contains all metadata about a single *cobra.Command's documentation
func ParseCommand ¶
func ParseCommand(cmd *cobra.Command) (CommandDoc, error)
type Flag ¶
type Flag struct { Name string Shorthand string ShorthandDeprecated string Deprecated string // Type references the type of variable the **??** TODO Type string Usage string // DefaultValue corresponds with pflag's DefValue: default value (as text); for usage message DefaultValue string // DefaultValueIfNoOptionProvided corresponds with pflag's NoOptDefVal: default value (as text); if the flag is on the command line without any options DefaultValueIfNoOptionProvided string }
func (Flag) NameAndShorthand ¶
type ParentCommand ¶
Click to show internal directories.
Click to hide internal directories.