sfackler / shell-escape

Apache License 2.0
20 stars 6 forks source link

Redo unix escaping #2

Closed sfackler closed 7 years ago

sfackler commented 7 years ago

Switch to single quoting the input with a whitelist of characters known to not need escaping.

Closes #1

Does this seem reasonable @joshtriplett?

Also cc @alexcrichton to make sure this won't break anything in cargo.

sfackler commented 7 years ago

This approach only works for sh/bash, I believe. That may be fine though?

sfackler commented 7 years ago

Ok, it now should also work with csh/tcsh, which I think should cover everything people would expect.

joshtriplett commented 7 years ago

Belated response: yes, this LGTM. And it'll produce much clearer quoted strings.