added parseopt.remainingArgs; refs #9951
This commit is contained in:
parent
f551b72fba
commit
3ba8f158fb
2 changed files with 6 additions and 0 deletions
|
|
@ -91,6 +91,7 @@ proc enumToString*(enums: openArray[enum]): string =
|
|||
of two texts by line.
|
||||
|
||||
- Added `os.relativePath`.
|
||||
- Added `parseopt.remainingArgs`.
|
||||
|
||||
### Library changes
|
||||
|
||||
|
|
|
|||
|
|
@ -234,6 +234,11 @@ when declared(os.paramCount):
|
|||
res.add quote(p.cmds[i])
|
||||
result = res.TaintedString
|
||||
|
||||
proc remainingArgs*(p: OptParser): seq[TaintedString] {.rtl, extern: "npo$1".} =
|
||||
## retrieves the rest of the command line that has not been parsed yet.
|
||||
result = @[]
|
||||
for i in p.idx..<p.cmds.len: result.add p.cmds[i]
|
||||
|
||||
iterator getopt*(p: var OptParser): tuple[kind: CmdLineKind, key, val: TaintedString] =
|
||||
## This is an convenience iterator for iterating over the given OptParser object.
|
||||
## Example:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue