From 156cd267e5ff2ed95305ffec13926c80afb388f7 Mon Sep 17 00:00:00 2001 From: Kyle Allan Date: Fri, 25 Jul 2014 10:06:04 -0700 Subject: [PATCH] move to CommandNotFound copy to startApp --- app.go | 3 --- command.go | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app.go b/app.go index 4ae0c5e..e193b82 100644 --- a/app.go +++ b/app.go @@ -151,9 +151,6 @@ func (a *App) RunAsSubcommand(ctx *Context) error { } } - // add the App's CommandNotFound - a.CommandNotFound = ctx.App.CommandNotFound - // append flags if a.EnableBashCompletion { a.appendFlag(BashCompletionFlag) diff --git a/command.go b/command.go index dcc8de5..5622b38 100644 --- a/command.go +++ b/command.go @@ -118,6 +118,9 @@ func (c Command) startApp(ctx *Context) error { app.Usage = c.Usage } + // set CommandNotFound + app.CommandNotFound = ctx.App.CommandNotFound + // set the flags and commands app.Commands = c.Subcommands app.Flags = c.Flags