mirror of
https://github.com/spf13/cobra
synced 2024-11-16 18:57:08 +00:00
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
1 changed files with 1 additions and 1 deletions
|
@ -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 a new issue