change "complete" to "shellComplete"

This commit is contained in:
Joshua Rubin 2016-11-14 09:35:22 -07:00
parent ea3df26e64
commit 8dd1962f7b
No known key found for this signature in database
GPG Key ID: 7E86D83E7AD27F82
3 changed files with 7 additions and 7 deletions

4
app.go
View File

@ -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 // 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 // note that we can only do this because the shell autocomplete function
// always appends the completion flag at the end of the command // always appends the completion flag at the end of the command
complete, arguments := checkCompleteFlag(a, arguments) shellComplete, arguments := checkShellCompleteFlag(a, arguments)
// parse flags // parse flags
set := flagSet(a.Name, a.Flags) set := flagSet(a.Name, a.Flags)
@ -188,7 +188,7 @@ func (a *App) Run(arguments []string) (err error) {
ShowAppHelp(context) ShowAppHelp(context)
return nerr return nerr
} }
context.complete = complete context.shellComplete = shellComplete
if checkCompletions(context) { if checkCompletions(context) {
return nil return nil

View File

@ -15,7 +15,7 @@ import (
type Context struct { type Context struct {
App *App App *App
Command Command Command Command
complete bool shellComplete bool
flagSet *flag.FlagSet flagSet *flag.FlagSet
setFlags map[string]bool setFlags map[string]bool
parentContext *Context parentContext *Context
@ -26,7 +26,7 @@ func NewContext(app *App, set *flag.FlagSet, parentCtx *Context) *Context {
c := &Context{App: app, flagSet: set, parentContext: parentCtx} c := &Context{App: app, flagSet: set, parentContext: parentCtx}
if parentCtx != nil { if parentCtx != nil {
c.complete = parentCtx.complete c.shellComplete = parentCtx.shellComplete
} }
return c return c

View File

@ -252,7 +252,7 @@ func checkSubcommandHelp(c *Context) bool {
return false return false
} }
func checkCompleteFlag(a *App, arguments []string) (bool, []string) { func checkShellCompleteFlag(a *App, arguments []string) (bool, []string) {
if !a.EnableBashCompletion { if !a.EnableBashCompletion {
return false, arguments return false, arguments
} }
@ -268,7 +268,7 @@ func checkCompleteFlag(a *App, arguments []string) (bool, []string) {
} }
func checkCompletions(c *Context) bool { func checkCompletions(c *Context) bool {
if !c.complete { if !c.shellComplete {
return false return false
} }
@ -285,7 +285,7 @@ func checkCompletions(c *Context) bool {
} }
func checkCommandCompletions(c *Context, name string) bool { func checkCommandCompletions(c *Context, name string) bool {
if !c.complete { if !c.shellComplete {
return false return false
} }