Skip to content

Commit b069387

Browse files
authored
Fix values with = being accepted and ignored for short flag options (#13)
Fixes a bug where short boolean flags allowed values, which were then ignored (e.g. `-f=value` where `-f` is a flag/boolean).
2 parents 6744c77 + eaa8528 commit b069387

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cmd/flag.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public class Flag {
104104
return false;
105105
return
106106
(query.startsWith("--") && longName == query[2..$])
107-
|| (query.startsWith("-") && shortName == query[1..2])
107+
|| (query.length == 2 && query.startsWith("-") && shortName == query[1..2])
108108
|| query == longName
109109
|| query == shortName;
110110
}

0 commit comments

Comments
 (0)