diff options
author | kitsunyan | 2018-04-29 14:12:03 +0000 |
---|---|---|
committer | kitsunyan | 2018-04-29 14:12:03 +0000 |
commit | 10e4e09cfc70730c1206e420d9bb337d37939b30 (patch) | |
tree | a004d02e9a91cf4a403dea7f9b1569545b045c4e /src/args.nim | |
parent | 924a732b2ffb672ed56b39bb06239d0105323f4a (diff) |
Properly handle "-" option
Diffstat (limited to 'src/args.nim')
-rw-r--r-- | src/args.nim | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/args.nim b/src/args.nim index 38fbcdb..0aba17c 100644 --- a/src/args.nim +++ b/src/args.nim @@ -34,7 +34,10 @@ iterator splitSingle(valueFull: string, optionsWithParameter: HashSet[OptionKey] var i = 0 while i < valueFull.len: let key = $valueFull[i] - if (key, false) in optionsWithParameter: + if key == "-": + raise commandError(trc("%s: invalid option -- '%c'\n") % + [getAppFilename(), key], showError = false) + elif (key, false) in optionsWithParameter: if i == valueFull.high: if next.isNone: raise commandError(trc("%s: option requires an argument -- '%c'\n") % |