Accepting Arg string in App.Run
This commit is contained in:
parent
0c14bbdc56
commit
04c645f6c6
3
cli.go
3
cli.go
@ -17,7 +17,8 @@ type Command struct {
|
|||||||
|
|
||||||
type Action func(name string)
|
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 {
|
for _, c := range a.Commands {
|
||||||
if c.Name == command {
|
if c.Name == command {
|
||||||
c.Action(command)
|
c.Action(command)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user