diff --git a/command.go b/command.go index 70502e8..d41a1bf 100644 --- a/command.go +++ b/command.go @@ -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)