Versions in this module Expand all Collapse all v1 v1.3.0 Jun 27, 2021 Changes in this version + const BashCompCustom + const BashCompFilenameExt + const BashCompOneRequiredFlag + const BashCompSubdirsInDir + var EnableCommandSorting = true + var EnablePrefixMatching = false + var MousetrapDisplayDuration time.Duration = 5 * time.Second + var MousetrapHelpText string = ... + func AddTemplateFunc(name string, tmplFunc interface{}) + func AddTemplateFuncs(tmplFuncs template.FuncMap) + func ArbitraryArgs(cmd *Command, args []string) error + func Eq(a interface{}, b interface{}) bool + func Gt(a interface{}, b interface{}) bool + func MarkFlagCustom(flags *pflag.FlagSet, name string, f string) error + func MarkFlagDirname(flags *pflag.FlagSet, name string) error + func MarkFlagFilename(flags *pflag.FlagSet, name string, extensions ...string) error + func MarkFlagRequired(flags *pflag.FlagSet, name string) error + func NoArgs(cmd *Command, args []string) error + func OnInitialize(y ...func()) + func OnlyValidArgs(cmd *Command, args []string) error + type Command struct + Aliases []string + Annotations map[string]string + ArgAliases []string + Args PositionalArgs + BashCompletionFunction string + Deprecated string + DisableAutoGenTag bool + DisableFlagParsing bool + DisableFlagsInUseLine bool + DisableSuggestions bool + Example string + FParseErrWhitelist FParseErrWhitelist + Hidden bool + Long string + PersistentPostRun func(cmd *Command, args []string) + PersistentPostRunE func(cmd *Command, args []string) error + PersistentPreRun func(cmd *Command, args []string) + PersistentPreRunE func(cmd *Command, args []string) error + PostRun func(cmd *Command, args []string) + PostRunE func(cmd *Command, args []string) error + PreRun func(cmd *Command, args []string) + PreRunE func(cmd *Command, args []string) error + Run func(cmd *Command, args []string) + RunE func(cmd *Command, args []string) error + Short string + SilenceErrors bool + SilenceUsage bool + SuggestFor []string + SuggestionsMinimumDistance int + TraverseChildren bool + Use string + ValidArgs []string + Version string + func (c *Command) AddCommand(cmds ...*Command) + func (c *Command) ArgsLenAtDash() int + func (c *Command) CalledAs() string + func (c *Command) CommandPath() string + func (c *Command) CommandPathPadding() int + func (c *Command) Commands() []*Command + func (c *Command) DebugFlags() + func (c *Command) ErrOrStderr() io.Writer + func (c *Command) Execute() error + func (c *Command) ExecuteC() (cmd *Command, err error) + func (c *Command) Find(args []string) (*Command, []string, error) + func (c *Command) Flag(name string) (flag *flag.Flag) + func (c *Command) FlagErrorFunc() (f func(*Command, error) error) + func (c *Command) Flags() *flag.FlagSet + func (c *Command) GenBashCompletion(w io.Writer) error + func (c *Command) GenBashCompletionFile(filename string) error + func (c *Command) GenPowerShellCompletion(w io.Writer) error + func (c *Command) GenPowerShellCompletionFile(filename string) error + func (c *Command) GenZshCompletion(w io.Writer) error + func (c *Command) GenZshCompletionFile(filename string) error + func (c *Command) GlobalNormalizationFunc() func(f *flag.FlagSet, name string) flag.NormalizedName + func (c *Command) HasAlias(s string) bool + func (c *Command) HasAvailableFlags() bool + func (c *Command) HasAvailableInheritedFlags() bool + func (c *Command) HasAvailableLocalFlags() bool + func (c *Command) HasAvailablePersistentFlags() bool + func (c *Command) HasAvailableSubCommands() bool + func (c *Command) HasExample() bool + func (c *Command) HasFlags() bool + func (c *Command) HasHelpSubCommands() bool + func (c *Command) HasInheritedFlags() bool + func (c *Command) HasLocalFlags() bool + func (c *Command) HasParent() bool + func (c *Command) HasPersistentFlags() bool + func (c *Command) HasSubCommands() bool + func (c *Command) Help() error + func (c *Command) HelpFunc() func(*Command, []string) + func (c *Command) HelpTemplate() string + func (c *Command) InOrStdin() io.Reader + func (c *Command) InheritedFlags() *flag.FlagSet + func (c *Command) InitDefaultHelpCmd() + func (c *Command) InitDefaultHelpFlag() + func (c *Command) InitDefaultVersionFlag() + func (c *Command) IsAdditionalHelpTopicCommand() bool + func (c *Command) IsAvailableCommand() bool + func (c *Command) LocalFlags() *flag.FlagSet + func (c *Command) LocalNonPersistentFlags() *flag.FlagSet + func (c *Command) MarkFlagCustom(name string, f string) error + func (c *Command) MarkFlagDirname(name string) error + func (c *Command) MarkFlagFilename(name string, extensions ...string) error + func (c *Command) MarkFlagRequired(name string) error + func (c *Command) MarkPersistentFlagDirname(name string) error + func (c *Command) MarkPersistentFlagFilename(name string, extensions ...string) error + func (c *Command) MarkPersistentFlagRequired(name string) error + func (c *Command) MarkZshCompPositionalArgumentFile(argPosition int, patterns ...string) error + func (c *Command) MarkZshCompPositionalArgumentWords(argPosition int, words ...string) error + func (c *Command) Name() string + func (c *Command) NameAndAliases() string + func (c *Command) NamePadding() int + func (c *Command) NonInheritedFlags() *flag.FlagSet + func (c *Command) OutOrStderr() io.Writer + func (c *Command) OutOrStdout() io.Writer + func (c *Command) Parent() *Command + func (c *Command) ParseFlags(args []string) error + func (c *Command) PersistentFlags() *flag.FlagSet + func (c *Command) Print(i ...interface{}) + func (c *Command) PrintErr(i ...interface{}) + func (c *Command) PrintErrf(format string, i ...interface{}) + func (c *Command) PrintErrln(i ...interface{}) + func (c *Command) Printf(format string, i ...interface{}) + func (c *Command) Println(i ...interface{}) + func (c *Command) RemoveCommand(cmds ...*Command) + func (c *Command) ResetCommands() + func (c *Command) ResetFlags() + func (c *Command) Root() *Command + func (c *Command) Runnable() bool + func (c *Command) SetArgs(a []string) + func (c *Command) SetErr(newErr io.Writer) + func (c *Command) SetFlagErrorFunc(f func(*Command, error) error) + func (c *Command) SetGlobalNormalizationFunc(n func(f *flag.FlagSet, name string) flag.NormalizedName) + func (c *Command) SetHelpCommand(cmd *Command) + func (c *Command) SetHelpFunc(f func(*Command, []string)) + func (c *Command) SetHelpTemplate(s string) + func (c *Command) SetIn(newIn io.Reader) + func (c *Command) SetOut(newOut io.Writer) + func (c *Command) SetOutput(output io.Writer) + func (c *Command) SetUsageFunc(f func(*Command) error) + func (c *Command) SetUsageTemplate(s string) + func (c *Command) SetVersionTemplate(s string) + func (c *Command) SuggestionsFor(typedName string) []string + func (c *Command) Traverse(args []string) (*Command, []string, error) + func (c *Command) Usage() error + func (c *Command) UsageFunc() (f func(*Command) error) + func (c *Command) UsagePadding() int + func (c *Command) UsageString() string + func (c *Command) UsageTemplate() string + func (c *Command) UseLine() string + func (c *Command) ValidateArgs(args []string) error + func (c *Command) VersionTemplate() string + func (c *Command) VisitParents(fn func(*Command)) + type FParseErrWhitelist flag.ParseErrorsWhitelist + type PositionalArgs func(cmd *Command, args []string) error + func ExactArgs(n int) PositionalArgs + func ExactValidArgs(n int) PositionalArgs + func MaximumNArgs(n int) PositionalArgs + func MinimumNArgs(n int) PositionalArgs + func RangeArgs(min int, max int) PositionalArgs