diff --git a/cli.go b/cli.go index ff06d75..a5ae417 100644 --- a/cli.go +++ b/cli.go @@ -24,7 +24,7 @@ func Run(args []string) { set := flagSet(Flags) set.Parse(args[1:]) - context := Context{} + context := NewContext(set) if len(args) > 1 { name := args[1] for _, c := range append(Commands, HelpCommand) { @@ -48,4 +48,4 @@ type Command struct { Flags []Flag } -type Handler func(context Context) +type Handler func(context *Context) diff --git a/help.go b/help.go index 72a4303..b5cb95e 100644 --- a/help.go +++ b/help.go @@ -22,7 +22,7 @@ func init() { HelpCommand.Action = ShowHelp } -func ShowHelp(c Context) { +func ShowHelp(c *Context) { helpTemplate := `NAME: {{.Name}} - {{.Usage}}