We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1e1ed08 commit 6f3aebbCopy full SHA for 6f3aebb
Readme.md
@@ -554,11 +554,13 @@ program.on('option:verbose', function () {
554
process.env.VERBOSE = this.verbose;
555
});
556
557
-// custom error on unknown command
558
program.on('command:*', function (operands) {
559
- console.error(`Invalid command '${operands[0]}'. Did you mean:`);
560
- console.error(mySuggestions(operands[0]));
561
- process.exit(1);
+ console.error(`error: unknown command '${operands[0]}'`);
+ const availableCommands = program.commands.map(cmd => cmd.name());
+ const suggestion = didYouMean(operands[0], availableCommands);
+ if (suggestion)
562
+ console.error(`Did you mean '${suggestion}'?`);
563
+ process.exitCode = 1;
564
565
```
566
0 commit comments