Made bash completion command optional; still need to update documentation

This commit is contained in:
Summer Mousa
2014-04-12 08:32:53 -05:00
parent 0b29bee364
commit 3a10545f91
4 changed files with 38 additions and 16 deletions

View File

@@ -29,10 +29,13 @@ func (c Command) Run(ctx *Context) error {
// append help to flags
c.Flags = append(
c.Flags,
BoolFlag{"generate-bash-completion", ""},
BoolFlag{"help, h", "show help"},
)
if ctx.App.EnableBashCompletion {
c.Flags = append(c.Flags, BashCompletionFlag)
}
set := flagSet(c.Name, c.Flags)
set.SetOutput(ioutil.Discard)