You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
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!
The text was updated successfully, but these errors were encountered: