Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Mark command parameter required if there is no fallback

This change results in:

 - The "command" parameter being shown as <required> rather than
   [optional] when there is no fallback set with .nocommand()

 - It being an error (thus showing help) if no command is passed when
   one is expected, and there is no fallback set with .nocommand()
  • Loading branch information...
commit 0aeab9c2c29ffa4f06e1fdd3ce1df27a86652893 1 parent c1a7bc5
@calmh calmh authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  nomnom.js
View
2  nomnom.js
@@ -153,6 +153,8 @@ ArgParser.prototype = {
if (this.fallback) {
_(this.specs).extend(this.fallback.specs);
this._help = this.fallback.help;
+ } else {
+ this.specs.command.required = true;
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.