diff --git a/app.go b/app.go index 50edf9a..9836d31 100644 --- a/app.go +++ b/app.go @@ -175,7 +175,7 @@ func (a *App) Run(arguments []string) (err error) { // flag name as the value of the flag before it which is undesirable // note that we can only do this because the shell autocomplete function // always appends the completion flag at the end of the command - complete, arguments := checkCompleteFlag(a, arguments) + shellComplete, arguments := checkShellCompleteFlag(a, arguments) // parse flags set := flagSet(a.Name, a.Flags) @@ -188,7 +188,7 @@ func (a *App) Run(arguments []string) (err error) { ShowAppHelp(context) return nerr } - context.complete = complete + context.shellComplete = shellComplete if checkCompletions(context) { return nil diff --git a/context.go b/context.go index 81404c4..4f440ec 100644 --- a/context.go +++ b/context.go @@ -15,7 +15,7 @@ import ( type Context struct { App *App Command Command - complete bool + shellComplete bool flagSet *flag.FlagSet setFlags map[string]bool parentContext *Context @@ -26,7 +26,7 @@ func NewContext(app *App, set *flag.FlagSet, parentCtx *Context) *Context { c := &Context{App: app, flagSet: set, parentContext: parentCtx} if parentCtx != nil { - c.complete = parentCtx.complete + c.shellComplete = parentCtx.shellComplete } return c diff --git a/help.go b/help.go index e453e72..e261bb6 100644 --- a/help.go +++ b/help.go @@ -252,7 +252,7 @@ func checkSubcommandHelp(c *Context) bool { return false } -func checkCompleteFlag(a *App, arguments []string) (bool, []string) { +func checkShellCompleteFlag(a *App, arguments []string) (bool, []string) { if !a.EnableBashCompletion { return false, arguments } @@ -268,7 +268,7 @@ func checkCompleteFlag(a *App, arguments []string) (bool, []string) { } func checkCompletions(c *Context) bool { - if !c.complete { + if !c.shellComplete { return false } @@ -285,7 +285,7 @@ func checkCompletions(c *Context) bool { } func checkCommandCompletions(c *Context, name string) bool { - if !c.complete { + if !c.shellComplete { return false }