summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2018-12-14 11:41:19 +0100
committerAraq <rumpf_a@web.de>2018-12-14 11:41:19 +0100
commit3ba8f158fb59372b492b353d60abeae343fdeef5 (patch)
tree8d202aaf31f9ca5298479ef67a4751b1913f92c5 /lib
parentf551b72fba30cb70bddfebad9d1398031b5ef620 (diff)
downloadNim-3ba8f158fb59372b492b353d60abeae343fdeef5.tar.gz
added parseopt.remainingArgs; refs #9951
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/parseopt.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/pure/parseopt.nim b/lib/pure/parseopt.nim
index fe3d3186f..8071fac93 100644
--- a/lib/pure/parseopt.nim
+++ b/lib/pure/parseopt.nim
@@ -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: