dthree / vorpal

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

include string commands (subcommands?) as one command #289

Closed ORESoftware closed 6 years ago

ORESoftware commented 6 years ago

Say we have this:

  vorpal.command('find [sumanOptions] [folder]')
  .description('find test files to run')
  .action(function (args: Array<string>, cb: Function) {
     // args => {sumanOptions: 'a b c'}
  });

how can I pass a string of commands ('subcommands') for sumanOptions? something like this:

vorpal> find "a b --fiz-biz=3 --foo=bar" myfolder

such that in the args in the action callback, looks like:

 // args => {sumanOptions: 'a b --fiz-biz=3 --foo=bar'}

I am looking to get the exact string contents there.

is this possible? or is this problem the "subcommands" issue I have been seeing in the issue tracker? I'd like to be able to do this, and so far, have not been able to figure out how to do it.

ORESoftware commented 6 years ago

I created this SO issue if someone wants points: https://stackoverflow.com/questions/47131449/node-js-vorpal-cli-include-subcommands-as-one-command