aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkitsunyan2018-04-29 14:12:03 +0000
committerkitsunyan2018-04-29 14:12:03 +0000
commit10e4e09cfc70730c1206e420d9bb337d37939b30 (patch)
treea004d02e9a91cf4a403dea7f9b1569545b045c4e
parent924a732b2ffb672ed56b39bb06239d0105323f4a (diff)
Properly handle "-" option
-rw-r--r--src/args.nim5
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") %