diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2019-01-15 12:51:02 -0800 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-01-15 21:51:02 +0100 |
commit | 795e5e11ef53260a0a15e25eba36dddbd83900c1 (patch) | |
tree | 274d7791a298fe9f93a43766c187382075caf479 /lib/pure | |
parent | beed27b75d27118324d89b83974b7cf3065769cf (diff) | |
download | Nim-795e5e11ef53260a0a15e25eba36dddbd83900c1.tar.gz |
parseopt2.cmdLineRest is now correct too (#10304)
Diffstat (limited to 'lib/pure')
-rw-r--r-- | lib/pure/parseopt2.nim | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/pure/parseopt2.nim b/lib/pure/parseopt2.nim index 51a70b6d1..a84943cf9 100644 --- a/lib/pure/parseopt2.nim +++ b/lib/pure/parseopt2.nim @@ -112,10 +112,10 @@ proc next(p: var OptParser) = p.key = token p.val = "" -proc cmdLineRest*(p: OptParser): TaintedString {.rtl, extern: "npo2$1", deprecated.} = - ## Returns part of command line string that has not been parsed yet. - ## Do not use - does not correctly handle whitespace. - return p.cmd[p.pos..p.cmd.len-1].join(" ") +proc cmdLineRest*(p: OptParser): TaintedString {.rtl, extern: "npo2$1".} = + ## Returns the part of command line string that has not been parsed yet, + ## properly quoted. + return p.cmd[p.pos..p.cmd.len-1].quoteShellCommand type GetoptResult* = tuple[kind: CmdLineKind, key, val: TaintedString] |