Permalink
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...
1 parent c1a7bc5 commit 0aeab9c2c29ffa4f06e1fdd3ce1df27a86652893 @calmh calmh committed Jul 12, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 nomnom.js
View
@@ -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;
}
}
}

0 comments on commit 0aeab9c

Please sign in to comment.