|
|
@ -24,6 +24,8 @@ type App struct {
|
|
|
|
EnableBashCompletion bool
|
|
|
|
EnableBashCompletion bool
|
|
|
|
// Boolean to hide built-in help command
|
|
|
|
// Boolean to hide built-in help command
|
|
|
|
HideHelp bool
|
|
|
|
HideHelp bool
|
|
|
|
|
|
|
|
// Boolean to hide built-in version flag
|
|
|
|
|
|
|
|
HideVersion bool
|
|
|
|
// An action to execute when the bash-completion flag is set
|
|
|
|
// An action to execute when the bash-completion flag is set
|
|
|
|
BashComplete func(context *Context)
|
|
|
|
BashComplete func(context *Context)
|
|
|
|
// An action to execute before any subcommands are run, but after the context is ready
|
|
|
|
// An action to execute before any subcommands are run, but after the context is ready
|
|
|
@ -75,7 +77,10 @@ func (a *App) Run(arguments []string) error {
|
|
|
|
if a.EnableBashCompletion {
|
|
|
|
if a.EnableBashCompletion {
|
|
|
|
a.appendFlag(BashCompletionFlag)
|
|
|
|
a.appendFlag(BashCompletionFlag)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if !a.HideVersion {
|
|
|
|
a.appendFlag(VersionFlag)
|
|
|
|
a.appendFlag(VersionFlag)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// parse flags
|
|
|
|
// parse flags
|
|
|
|
set := flagSet(a.Name, a.Flags)
|
|
|
|
set := flagSet(a.Name, a.Flags)
|
|
|
|