From 4ab8f6b3e2434a975d17b9c08138cd80e3e2128d Mon Sep 17 00:00:00 2001 From: Jeremy Saenz Date: Tue, 16 Jul 2013 07:52:55 -0700 Subject: [PATCH 1/2] JMS #2: Renamed "Action" type to handler. --- cli.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cli.go b/cli.go index 419d342..6c3d206 100644 --- a/cli.go +++ b/cli.go @@ -18,7 +18,7 @@ var Commands []Command var Flags []Flag // The action to execute when no subcommands are specified -var DefaultAction = ShowHelp +var Action = ShowHelp func Run(args []string) { if len(args) > 1 { @@ -32,7 +32,7 @@ func Run(args []string) { } // Run default Action - DefaultAction("") + Action("") } type Command struct { @@ -40,8 +40,8 @@ type Command struct { ShortName string Usage string Description string - Action Action + Action Handler Flags flag.FlagSet } -type Action func(name string) +type Handler func(name string) From e2de64ea4de8200884cbefcccc248da1489f35bc Mon Sep 17 00:00:00 2001 From: Jeremy Saenz Date: Tue, 16 Jul 2013 07:54:11 -0700 Subject: [PATCH 2/2] JMS #2: Formmating --- cli.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli.go b/cli.go index 6c3d206..a27f9dd 100644 --- a/cli.go +++ b/cli.go @@ -41,7 +41,7 @@ type Command struct { Usage string Description string Action Handler - Flags flag.FlagSet + Flags flag.FlagSet } type Handler func(name string)