Is it possible to use regex syntax to define the name of a command, for example:
vorpal .command(/\d/) // accepts any digit ...
The use case for this is to have dynamic commands that could include extra logic depending on the combination of words or digits.
A workaround could be, once the program is running through vorpal.show(); allow input without command and run them through a default action, instead of showing the error message.
Example:
vorpal .command([digits]) // accepts any digit instead of error message .action((args,callback) => { 'regex processing or any other use' ... })
Is it possible to use regex syntax to define the name of a command, for example:
vorpal .command(/\d/) // accepts any digit ...
The use case for this is to have dynamic commands that could include extra logic depending on the combination of words or digits.
A workaround could be, once the program is running through vorpal.show(); allow input without command and run them through a default action, instead of showing the error message.
Example:
vorpal .command([digits]) // accepts any digit instead of error message .action((args,callback) => { 'regex processing or any other use' ... })
Thank you!