Accepting Arg string in App.Run

This commit is contained in:
Jeremy Saenz 2013-07-14 07:42:37 -07:00
parent 0c14bbdc56
commit 04c645f6c6

3
cli.go
View File

@ -17,7 +17,8 @@ type Command struct {
type Action func(name string)
func (a App) Run(command string) {
func (a App) Run(args []string) {
command := args[1]
for _, c := range a.Commands {
if c.Name == command {
c.Action(command)