Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'TheRoSS-master' into release/3.0.0
- Loading branch information
Showing
2 changed files
with
34 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
var program = require('../') | ||
, should = require('should'); | ||
|
||
program | ||
.option('-c <required>', 'required with adjacent value') | ||
.option('-q <required>', 'required with separated value') | ||
.option('-o [optional]', 'optional with adjacent value') | ||
.option('-p [optional]', 'optional with separated value') | ||
.option('-n [optional]', 'optional without value in the middle') | ||
.option('-r [optional]', 'optional without value in the end'); | ||
|
||
program.parse(['node', 'test', '-c22', '-q', '33', '-o44', '-n', '-p', '55', '-r']); | ||
program.C.should.equal('22'); | ||
program.Q.should.equal('33'); | ||
program.O.should.equal('44'); | ||
program.N.should.equal(true); | ||
program.P.should.equal('55'); | ||
program.R.should.equal(true); |