From bdb9c5ab61742eaebcec62d192eb11fb6cd69f0e Mon Sep 17 00:00:00 2001 From: Jeremy Saenz Date: Sun, 14 Jul 2013 18:00:03 -0700 Subject: [PATCH] Support for shortnames --- cli.go | 2 +- help.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli.go b/cli.go index b1d9015..d7c7628 100644 --- a/cli.go +++ b/cli.go @@ -20,7 +20,7 @@ func Run(args []string) { if len(args) > 1 { name := args[1] for _, c := range append(Commands, HelpCommand) { - if c.Name == name { + if c.Name == name || c.ShortName == name { c.Action(name) return } diff --git a/help.go b/help.go index 9660022..bb13b81 100644 --- a/help.go +++ b/help.go @@ -29,7 +29,7 @@ VERSION: {{.Version}} COMMANDS: - {{range .Commands}}{{.Name}}{{ "\t" }}{{.Usage}} + {{range .Commands}}{{.Name}}{{with .ShortName}}, {{.}}{{end}}{{ "\t" }}{{.Usage}} {{end}} ` data := HelpData{