mirror of
https://github.com/status-im/nim-confutils.git
synced 2025-03-02 12:50:31 +00:00
Fix #6
This commit is contained in:
parent
31c9f9ae38
commit
6f5f030539
@ -114,7 +114,8 @@ proc next*(p: var OptParser) =
|
||||
inc(i)
|
||||
while i < p.cmds[p.idx].len and p.cmds[p.idx][i] in {'\t', ' '}: inc(i)
|
||||
# if we're at the end, use the next command line option:
|
||||
if i >= p.cmds[p.idx].len and p.idx < p.cmds.len and p.allowWhitespaceAfterColon:
|
||||
if p.allowWhitespaceAfterColon and i >= p.cmds[p.idx].len and
|
||||
p.idx + 1 < p.cmds.len and p.cmds[p.idx + 1][0] != '-':
|
||||
inc p.idx
|
||||
i = 0
|
||||
if p.idx < p.cmds.len:
|
||||
|
7
tests/issue_6.nim
Normal file
7
tests/issue_6.nim
Normal file
@ -0,0 +1,7 @@
|
||||
import confutils
|
||||
|
||||
# TODO add test cases for https://github.com/status-im/nim-confutils/issues/6
|
||||
cli do (arg1: string = "", arg2: string = ""):
|
||||
echo "arg1: ", arg1
|
||||
echo "arg2: ", arg2
|
||||
|
Loading…
x
Reference in New Issue
Block a user