Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
Add test for required/optional argument difference.
Browse files Browse the repository at this point in the history
  • Loading branch information
calmh committed Jun 14, 2012
1 parent 20eabcc commit 0f51d55
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/usage.js
Expand Up @@ -91,3 +91,25 @@ exports.testHidden = function(test) {
})
.parse(["-h"]);
}

exports.testRequiredOptional = function(test) {
test.expect(1);

nomnom().options({
foo: {
position: 0,
required: true,
help: 'The foo'
},
bar: {
position: 1,
help: 'The bar'
}
})
.scriptName("test")
.printer(function(string) {
test.equal(strip("Usage:test<foo>[bar]fooThefoobarThebar"), strip(string))
test.done();
})
.parse(["-h"]);
}

0 comments on commit 0f51d55

Please sign in to comment.