mirror of
https://github.com/spf13/cobra
synced 2024-11-24 14:47:12 +00:00
Use nil instead of len for arg check.
This honors the SetArgs() call
This commit is contained in:
parent
bbdcadf158
commit
1ef0913976
1 changed files with 1 additions and 1 deletions
|
@ -635,7 +635,7 @@ func (c *Command) ExecuteC() (cmd *Command, err error) {
|
||||||
var args []string
|
var args []string
|
||||||
|
|
||||||
// Workaround FAIL with "go test -v" or "cobra.test -test.v", see #155
|
// 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:]
|
args = os.Args[1:]
|
||||||
} else {
|
} else {
|
||||||
args = c.args
|
args = c.args
|
||||||
|
|
Loading…
Reference in a new issue