Skip to content

Commit

Permalink
Use nil instead of len for arg check.
Browse files Browse the repository at this point in the history
This honors the SetArgs() call
  • Loading branch information
jonreyna authored and spf13 committed Feb 8, 2016
1 parent bbdcadf commit 1ef0913
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1ef0913

Please sign in to comment.