Customizable command not found function

This commit is contained in:
Chris Winslett
2014-03-30 20:40:46 -07:00
parent 3fa24ca4f3
commit 37299d4e5a
3 changed files with 30 additions and 1 deletions

View File

@@ -73,7 +73,11 @@ func ShowCommandHelp(c *Context, command string) {
}
}
fmt.Printf("No help topic for '%v'\n", command)
if c.App.CommandNotFound != nil {
c.App.CommandNotFound(c, command)
} else {
fmt.Printf("No help topic for '%v'\n", command)
}
}
// Prints the version number of the App