Using this:
vorpal
.command("echo <somewords>")
.description("Outputs 'what ever you typed")
.action(function (args, callback) {
this.log(args.somewords);
callback();
});
I can enter: echo 'some text to echo' and that works as expected, but echo "some other text" just echo's "some
TIA
You can do this using variadic arguments, by adding a ...
to the argument. This returns each word back in an array:
vorpal
.command("echo <somewords...>")
.description("Outputs 'what ever you typed")
.action(function (args, callback) {
this.log(args.somewords.join(' '));
callback();
});