dthree / vorpal

Node's framework for interactive CLIs
http://vorpal.js.org
MIT License
5.63k stars 278 forks source link

access raw unparsed command ? #344

Open whatsdis opened 5 years ago

whatsdis commented 5 years ago

sending a command with a value like : ['//a[@id="pagination"]/a[5]',3]

results in

[\'//a[@ id=\'pagination\' ]/a[5]\',3]

This has been causing a lot of problems, is there a way to turn off this auto-escaping or accessing the unparsed raw command?

igorclark commented 4 years ago

Hi folks, just picking up Vorpal and finding this a problem too (although Vorpal is pretty amazing otherwise!).

I want to do variadic arguments to capture whole strings with arbitrary characters, but any time the string contains a " the parsing breaks because vorpal.command() has stripped out the quotes.

It works fine when I run it as a vorpal.mode() - the whole string is passed straight through, as expected, including the quotes - but I want it as a command so it can be part of the history.

Any ideas how to turn this off, or if it's not intentional then where I can look around in the source in case I can fork and modify?

Thanks!