mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 18:02:05 +00:00
added parseopt.remainingArgs; refs #9951
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user