make cmd.Run use varargs

This commit is contained in:
Naveen Gogineni
2022-10-10 18:32:56 -04:00
parent adcce134f3
commit 59095aa762
8 changed files with 33 additions and 33 deletions

View File

@@ -163,7 +163,7 @@ func (c *Command) setup(ctx *Context) {
c.Subcommands = newCmds
}
func (c *Command) Run(cCtx *Context, arguments []string) (err error) {
func (c *Command) Run(cCtx *Context, arguments ...string) (err error) {
if !c.isRoot {
c.setup(cCtx)
@@ -286,7 +286,7 @@ func (c *Command) Run(cCtx *Context, arguments []string) (err error) {
if cmd != nil {
newcCtx := NewContext(cCtx.App, nil, cCtx)
newcCtx.Command = cmd
return cmd.Run(newcCtx, cCtx.Args().Slice())
return cmd.Run(newcCtx, cCtx.Args().Slice()...)
}
if c.Action == nil {