Versions in this module Expand all Collapse all v0 v0.2.0 Jun 12, 2026 Changes in this version + var ErrDisplayHelp = errors.New("help") + var ErrDisplayUsage = errors.New("usage") + var ErrUnderlyingError = errors.New("underlying error") + func ArbitraryArgs(_ *Command, _ []string) error + func ConfigureRootCommand(i *Invocation, cmd *Command) + func GenMarkdown(c *Command, w io.Writer, link LinkHandler) error + func GenMarkdownTree(c *Command, dir string, link LinkHandler) error + func GenNavJSON(c *Command, w io.Writer) error + func NewExitError(code int, wrapErr error) error + func NoArgs(_ *Command, args []string) error + func RootHelpFunc(c *Command) func(map[string]cli.CommandFactory) string + func ToCommandMap(c *Command, inv *Invocation) map[string]cli.CommandFactory + type Command struct + AdditionalDocs []DocSection + Aliases []string + Args PositionalArguments + Examples []Example + Flags Flags + Hidden bool + LongHelp string + Name string + NoAuthRequired bool + PersistentPreRun func(c *Command, args []string) error + RunF func(c *Command, args []string) error + ShortHelp string + func (c *Command) AddChild(cmd *Command) + func (c *Command) CommandPath() string + func (c *Command) Run(args []string, inv *Invocation) int + func (c *Command) SetIO(io iostreams.IOStreams) + func (c *Command) Validate() error + type CompatibleCommand struct + func (cc *CompatibleCommand) AutocompleteArgs() complete.Predictor + func (cc *CompatibleCommand) AutocompleteFlags() complete.Flags + func (cc *CompatibleCommand) Help() string + func (cc *CompatibleCommand) HelpTemplate() string + func (cc *CompatibleCommand) Run(args []string) int + func (cc *CompatibleCommand) Synopsis() string + type DocNavItem struct + Href string + Path string + Routes []*DocNavItem + Title string + type DocSection struct + Documentation string + Title string + type Example struct + Command string + Preamble string + type ExitCodeError struct + Code int + Err error + func (e *ExitCodeError) Error() string + func (e *ExitCodeError) Unwrap() error + type Flag struct + Autocomplete complete.Predictor + Description string + DisplayValue string + Hidden bool + InvertBooleanNoValue bool + IsBooleanFlag bool + Name string + Repeatable bool + Required bool + Shorthand string + Value flagvalue.Value + type Flags struct + Local []*Flag + Persistent []*Flag + type GlobalFlags struct + Quiet bool + Version bool + type Invocation struct + IO iostreams.IOStreams + Output *format.Outputter + Profile *profile.Profile + ShutdownCtx context.Context + func (i *Invocation) GetGlobalFlags() GlobalFlags + func (i *Invocation) IsDryRun() bool + func (i *Invocation) NewAPIClient() (*client.Client, error) + func (i *Invocation) ParseFlags(c *Command, args []string) ([]string, error) + func (i *Invocation) ResolveLogLevel() hclog.Level + type LinkHandler func(path string) string + type PositionalArgument struct + Documentation string + Name string + Optional bool + Repeatable bool + type PositionalArguments struct + Args []PositionalArgument + Autocomplete complete.Predictor + Preamble string + Validate ValidateArgsFunc + type ValidateArgsFunc func(c *Command, args []string) error + func ExactArgs(n int) ValidateArgsFunc + func MaximumNArgs(n int) ValidateArgsFunc + func MinimumNArgs(n int) ValidateArgsFunc + func RangeArgs(minimum int, maximum int) ValidateArgsFunc