From 10e4e09cfc70730c1206e420d9bb337d37939b30 Mon Sep 17 00:00:00 2001 From: kitsunyan Date: Sun, 29 Apr 2018 17:12:03 +0300 Subject: Properly handle "-" option --- src/args.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/args.nim') 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") % -- cgit v1.2.3-70-g09d2