ljharb / shell-quote

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No way to specify multiple escape characters

haltman-at opened this issue · comments

For some uses, it might be nice to be able to specify multiple characters any of which can act as an escape. Right now you can only have one escape character, as best I can tell; if you pass a multi-character string as the escape character, the result is that you won't be able to escape at all.

Thanks!

What form would you expect?

I can imagine a regular expression or a predicate function, but those could have unpredictable results - a simpler option is to accept an array of multiple strings, but that would break anyone who'd been passing in an array of a single character. However, I'd hope nobody is doing this.

Accepting multiple characters as a single string is also a possibility -- a character is an escape if it appears in the string.

true. altho it's probably more likely that someone is using a multi-char escape sequence than that they're passing an array containing one item