mirror of
https://github.com/spf13/cobra
synced 2024-08-23 17:26:33 +00:00
tiny fix for removeParentPersistentArgs
This commit is contained in:
parent
c67af4c687
commit
99d0be84df
|
@ -1828,9 +1828,7 @@ func (c *Command) parseShortArgs(s string, args []string) (passedArgs []string,
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Command) removeParentPersistentArgs(args []string) []string {
|
func (c *Command) removeParentPersistentArgs(args []string) (newArgs []string) {
|
||||||
var newArgs []string
|
|
||||||
|
|
||||||
for len(args) > 0 {
|
for len(args) > 0 {
|
||||||
s := args[0]
|
s := args[0]
|
||||||
args = args[1:]
|
args = args[1:]
|
||||||
|
@ -1850,8 +1848,7 @@ func (c *Command) removeParentPersistentArgs(args []string) []string {
|
||||||
}
|
}
|
||||||
args = restArgs
|
args = restArgs
|
||||||
}
|
}
|
||||||
|
return
|
||||||
return newArgs
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParseFlags parses persistent flag tree and local flags.
|
// ParseFlags parses persistent flag tree and local flags.
|
||||||
|
|
Loading…
Reference in a new issue