Hinting command when user types an invalid command
- Dominant language
- JavaScript
- Stars
- 5.6k
- Forks
- 278
- PR merge metrics
- No merged PRs in 30d
Description
Maybe we can add an additional implementation to display similiar command when user types an invalid command
Example:
```
vorpal
.command('foo', 'Outputs "foo".')
.action(function(args, callback()) {
this.log('foo');
callback();
});
vorpal
.catch('[words...]', 'Catches incorrect commands')
.action(function (args, callback()) {
this.log(args.words.join(' ') + ' is not a valid command.');
// new function
// something like vorpal.similiar(args.words[0])
// to display similiar commands
callback();
});
```
When user type `node command.js foozz`, it will output:
```
foozz is not a valid command. Maybe you mean:
foo
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.