Closed jamesgeorge007 closed 3 years ago
npm install commander@latest
https://github.com/madlabsinc/mevn-cli/blob/develop/src/cli.js
@@ -89,9 +89,11 @@ program
.then(console.log);
});
-program.arguments('<command>').action((cmd) => {
+// Validation for unknown commands
+program.on('command:*', ([cmd]) => {
program.outputHelp();
- console.log(` ` + chalk.red(`\n Unknown command ${chalk.yellow(cmd)}.`));
+ console.log();
+ console.error(` Unknown command ${chalk.yellow(cmd)}.`);
console.log();
suggestCommands(cmd);
});
working on this
Currently, the project depends on commander.js v2 while we have v6 as the latest stable release. We can safely bump the package.