make parseopt work with DLLs on Unix
This commit is contained in:
parent
e02e057a70
commit
a42150f9a8
1 changed files with 8 additions and 7 deletions
|
|
@ -227,13 +227,14 @@ proc next*(p: var OptParser) {.rtl, extern: "npo$1".} =
|
||||||
inc p.idx
|
inc p.idx
|
||||||
p.pos = 0
|
p.pos = 0
|
||||||
|
|
||||||
proc cmdLineRest*(p: OptParser): TaintedString {.rtl, extern: "npo$1".} =
|
when declared(os.paramCount):
|
||||||
## retrieves the rest of the command line that has not been parsed yet.
|
proc cmdLineRest*(p: OptParser): TaintedString {.rtl, extern: "npo$1".} =
|
||||||
var res = ""
|
## retrieves the rest of the command line that has not been parsed yet.
|
||||||
for i in p.idx..<p.cmds.len:
|
var res = ""
|
||||||
if i > p.idx: res.add ' '
|
for i in p.idx..<p.cmds.len:
|
||||||
res.add quote(p.cmds[i])
|
if i > p.idx: res.add ' '
|
||||||
result = res.TaintedString
|
res.add quote(p.cmds[i])
|
||||||
|
result = res.TaintedString
|
||||||
|
|
||||||
iterator getopt*(p: var OptParser): tuple[kind: CmdLineKind, key, val: TaintedString] =
|
iterator getopt*(p: var OptParser): tuple[kind: CmdLineKind, key, val: TaintedString] =
|
||||||
## This is an convenience iterator for iterating over the given OptParser object.
|
## This is an convenience iterator for iterating over the given OptParser object.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue