Open minhchu opened 8 years ago
Good idea. I would probably want to t urn this on by default, and only if there isn't a vorpal.catch
command declared. Then it could be turned off like:
const vorpal = require('vorpal');
vorpal.delimiter('foo').hints(false).show();
What do you think?
You could probably do a PR on this pretty easily, just use the leven
module for Levenshtein distance by @sindresorhus , which you could pick the top score under a certain threshhold of edit distance. This isn't computationally expensive and is a small add.
Should probably go in here:
https://github.com/dthree/vorpal/blob/master/lib/vorpal.js#L1027
Thanks for your advice. I'll try to do a PR.
Maybe we can add an additional implementation to display similiar command when user types an invalid command Example:
When user type
node command.js foozz
, it will output: