Skip to content

Commit 100e96e

Browse files
committed
[readme] document that quote outputs POSIX quoting, not cmd.exe/PowerShell
See #25 (comment)
1 parent 801af5c commit 100e96e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,16 @@ Each entry of `args` may be a string, or one of the object shapes that
114114
other object shape, an unrecognized `op`, or a `pattern`/`comment`
115115
containing line terminators throws a `TypeError`.
116116

117+
The output is POSIX shell (`sh`/`bash`) quoting.
118+
It is not valid for Windows `cmd.exe` or PowerShell,
119+
whose rules differ and, for `cmd.exe`,
120+
are not solvable in the general case. On Windows,
121+
do not build a shell command string from this output;
122+
instead pass an argument array to a non-shell API such as
123+
`child_process.execFile` or `spawn`
124+
(or the `cross-spawn` package),
125+
which does no shell parsing and needs no quoting.
126+
117127
## parse(cmd, env={})
118128

119129
Return an array of arguments from the quoted string `cmd`.

0 commit comments

Comments
 (0)