Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Mark command parameter required if there is no fallback #20

Merged
merged 1 commit into from

2 participants

@calmh

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()

@calmh calmh 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()
0aeab9c
@harthur harthur merged commit 89c0b2c into harthur:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 12, 2012
  1. @calmh

    Mark command parameter required if there is no fallback

    calmh authored
    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()
This page is out of date. Refresh to see the latest.
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;
}
}
}
Something went wrong with that request. Please try again.