mirror of
https://github.com/spf13/cobra
synced 2025-05-05 12:57:22 +00:00
support -f example
This commit is contained in:
parent
981fa24569
commit
7a0f61e6a5
1 changed files with 5 additions and 0 deletions
|
@ -603,6 +603,11 @@ Loop:
|
||||||
args = args[1:]
|
args = args[1:]
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
case strings.HasPrefix(s, "-") && !strings.Contains(s, "=") && len(s) == 2 && shortHasNoOptDefVal(s[1:], flags):
|
||||||
|
// If '-f' then
|
||||||
|
// delete '-f' from args or break the loop if len(args) <= 1.
|
||||||
|
beforeArgs = append(beforeArgs, s)
|
||||||
|
continue
|
||||||
case s != "" && !strings.HasPrefix(s, "-"):
|
case s != "" && !strings.HasPrefix(s, "-"):
|
||||||
command = s
|
command = s
|
||||||
afterArgs = args
|
afterArgs = args
|
||||||
|
|
Loading…
Add table
Reference in a new issue