change "complete" to "shellComplete"

main
Joshua Rubin 8 years ago
parent ea3df26e64
commit 8dd1962f7b
No known key found for this signature in database
GPG Key ID: 7E86D83E7AD27F82

@ -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

@ -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

@ -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
}

Loading…
Cancel
Save