parseopt2.cmdLineRest is now correct too (#10304)
This commit is contained in:
parent
beed27b75d
commit
795e5e11ef
2 changed files with 23 additions and 20 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue