move to CommandNotFound copy to startApp

This commit is contained in:
Kyle Allan 2014-07-25 10:06:04 -07:00
parent 1880853f15
commit 156cd267e5
2 changed files with 3 additions and 3 deletions

3
app.go
View File

@ -151,9 +151,6 @@ func (a *App) RunAsSubcommand(ctx *Context) error {
} }
} }
// add the App's CommandNotFound
a.CommandNotFound = ctx.App.CommandNotFound
// append flags // append flags
if a.EnableBashCompletion { if a.EnableBashCompletion {
a.appendFlag(BashCompletionFlag) a.appendFlag(BashCompletionFlag)

View File

@ -118,6 +118,9 @@ func (c Command) startApp(ctx *Context) error {
app.Usage = c.Usage app.Usage = c.Usage
} }
// set CommandNotFound
app.CommandNotFound = ctx.App.CommandNotFound
// set the flags and commands // set the flags and commands
app.Commands = c.Subcommands app.Commands = c.Subcommands
app.Flags = c.Flags app.Flags = c.Flags