From 1ef0913976db2004980575ed815c30c65acd5599 Mon Sep 17 00:00:00 2001 From: Jonathan Reyna Date: Wed, 13 Jan 2016 23:55:11 -0500 Subject: [PATCH] Use nil instead of len for arg check. This honors the SetArgs() call --- command.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command.go b/command.go index 9b7a006c..ccc41c38 100644 --- a/command.go +++ b/command.go @@ -635,7 +635,7 @@ func (c *Command) ExecuteC() (cmd *Command, err error) { var args []string // Workaround FAIL with "go test -v" or "cobra.test -test.v", see #155 - if len(c.args) == 0 && filepath.Base(os.Args[0]) != "cobra.test" { + if c.args == nil && filepath.Base(os.Args[0]) != "cobra.test" { args = os.Args[1:] } else { args = c.args