As per the commander.js readme, I can specify the default command thus:
var program = ...;
program
...
.command('list', 'list packages installed', {isDefault: true})
.parse(process.argv);
In my application, I'm using the .command() without the description parameter, for using .action(). I tried passing the second param null and the third option with the isDefault:true. But it does not seem to work:
program.command('help', null, {isDefault:true})
.description('display help information.')
.action(function(){
program.outputHelp();
});
How do I pass isDefault:true to a command with .action()?