visionmedia/commander.js — Issue #39: Manually triggering usage
Author: remy
Created: 2011-12-30 15:23:37+00:00
State: open

My app wanted to trigger the usage if there's no arguments, but I couldn't see from the docs the right way of doing this.

Checking the code, I ended up calling the `program.helpInformation()` directly - not sure if this is right. If it is, possibly worth adding to the README?

Usage example:

if (program.args.length == 0) {
console.log(program.helpInformation());
process.exit();
}