add a check

This commit is contained in:
Lynn Cyrin 2019-10-01 20:18:53 -07:00
parent 51259808ff
commit be0cc4b871

View File

@ -261,6 +261,10 @@ func argIsFlag(commandFlags []Flag, arg string) bool {
if arg == "-" {
return false
}
// flags always start with a -
if !strings.HasPrefix(arg, "-") {
return false
}
// this line turns `--flag` into `flag`
if strings.HasPrefix(arg, "--") {
arg = strings.Replace(arg, "-", "", 2)