Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix examples/help. Closes #89

  • Loading branch information...
commit 1fc8330ffd92aab3970414e95e0ecce2631bdc9d 1 parent 7cb5aeb
@tj authored
Showing with 12 additions and 1 deletion.
  1. +1 −1  examples/help
  2. +11 −0 lib/commander.js
View
2  examples/help
@@ -13,5 +13,5 @@ program
.option('-B, --baz', 'enable some baz')
.parse(process.argv);
-if (!process.argv.length) program.help();
+if (!program.args.length) program.help();
View
11 lib/commander.js
@@ -995,6 +995,17 @@ Command.prototype.outputHelp = function(){
};
/**
+ * Output help information and exit.
+ *
+ * @api public
+ */
+
+Command.prototype.help = function(){
+ this.outputHelp();
+ process.exit();
+};
+
+/**
* Camel-case the given `flag`
*
* @param {String} flag
Please sign in to comment.
Something went wrong with that request. Please try again.