Possibly helpful. The impl on Windows & Unix differs (big `when` and documented differences in `lib/std/cmdline.nim`). On Linux one sees (instead of what @enthus1ast describes): import os let x = r"""--title "new title with whitespace"""" # ^space needed can skip 1^ echo "inp: ", x.repr echo "prs: ", x.parseCmdLine #Output: # inp: "--title \"new title with whitespace\"" # prs: @["--title", "new title with whitespace"] Run
Doing full shell lexing (&| a variety of string splitters) was discussed [in a PR](https://github.com/nim-lang/Nim/pull/18622) which had trouble getting merged due to detailed PR mechanics.