Adding VersionPrinter and tests.

This commit is contained in:
Joshua Mervine
2014-06-17 21:37:55 -07:00
committed by Josh Mervine
parent bb9189510a
commit 5821632000
2 changed files with 28 additions and 1 deletions

View File

@@ -92,6 +92,9 @@ var helpSubcommand = Command{
// Prints help for the App
var HelpPrinter = printHelp
// Prints version for the App
var VersionPrinter = printVersion
func ShowAppHelp(c *Context) {
HelpPrinter(AppHelpTemplate, c.App)
}
@@ -129,6 +132,10 @@ func ShowSubcommandHelp(c *Context) {
// Prints the version number of the App
func ShowVersion(c *Context) {
VersionPrinter(c)
}
func printVersion(c *Context) {
fmt.Printf("%v version %v\n", c.App.Name, c.App.Version)
}