mirror of https://github.com/spf13/cobra.git
adds check to see if command name and os.Args[0] is the same before applying os.Args as it was leading appending false arguments from the test suite
This commit is contained in:
parent
b28774dd68
commit
ff4a381d80
|
@ -566,7 +566,7 @@ func (c *Command) Execute() (err error) {
|
||||||
|
|
||||||
var args []string
|
var args []string
|
||||||
|
|
||||||
if len(c.args) == 0 {
|
if len(c.args) == 0 && os.Args[0] == c.Name() {
|
||||||
args = os.Args[1:]
|
args = os.Args[1:]
|
||||||
} else {
|
} else {
|
||||||
args = c.args
|
args = c.args
|
||||||
|
|
Loading…
Reference in New Issue