madlabsinc / mevn-cli

Light speed setup for MEVN(Mongo Express Vue Node) Apps
https://mevn.surge.sh
MIT License
825 stars 152 forks source link

bump commander.js to v6 #207

Closed jamesgeorge007 closed 3 years ago

jamesgeorge007 commented 3 years ago

Currently, the project depends on commander.js v2 while we have v6 as the latest stable release. We can safely bump the package.

jamesgeorge007 commented 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);
 });
Creatoon commented 3 years ago

working on this