Accepting Arg string in App.Run
This commit is contained in:
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)
|
||||||
|
Reference in New Issue
Block a user