add a check
This commit is contained in:
parent
51259808ff
commit
be0cc4b871
@ -261,6 +261,10 @@ func argIsFlag(commandFlags []Flag, arg string) bool {
|
|||||||
if arg == "-" {
|
if arg == "-" {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
// flags always start with a -
|
||||||
|
if !strings.HasPrefix(arg, "-") {
|
||||||
|
return false
|
||||||
|
}
|
||||||
// this line turns `--flag` into `flag`
|
// this line turns `--flag` into `flag`
|
||||||
if strings.HasPrefix(arg, "--") {
|
if strings.HasPrefix(arg, "--") {
|
||||||
arg = strings.Replace(arg, "-", "", 2)
|
arg = strings.Replace(arg, "-", "", 2)
|
||||||
|
Loading…
Reference in New Issue
Block a user