mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
flag: fix panic on single -
This commit is contained in:
@@ -176,7 +176,7 @@ fn (mut fs FlagParser) parse_bool_value(longhand string, shorthand byte) ?string
|
||||
fs.args.delete(i)
|
||||
return val
|
||||
}
|
||||
if arg[0] == `-` && arg[1] != `-` && arg.index_byte(shorthand) != -1 {
|
||||
if arg.len > 1 && arg[0] == `-` && arg[1] != `-` && arg.index_byte(shorthand) != -1 {
|
||||
// -abc is equivalent to -a -b -c
|
||||
return 'true'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user