test.options.func.js
This file
Path
test/test.options.func.js
23 lines · 717 bytes · JavaScript
Last changed by
Merge pull request #353 from nkzawa/patch-0Randall Koutnikbefore adoption2120cb1
History of this fileTake it
Merge pull request #262 from tonylukasavage/options_funcThomas Geraghtybefore adoption6089ed4
lines 1–9why, one step back1var program = require('../')2 , should = require('should');34program5 .version('0.0.1')6 .description('sdfdsfsfsdfdsf')7 .option('-f, --foo', 'add some foo')8 .option('-b, --bar', 'add some bar')9 .option('-M, --no-magic', 'disable magic')Merge pull request #353 from nkzawa/patch-0Randall Koutnikbefore adoption2120cb1
line 10why, one step back10 .option('-c, --camel-case', 'convert to camelCase')Merge pull request #262 from tonylukasavage/options_funcThomas Geraghtybefore adoption6089ed4
lines 11–12why, one step back11 .option('-q, --quux <quux>', 'add some quux');12Merge pull request #353 from nkzawa/patch-0Randall Koutnikbefore adoption2120cb1
line 13why, one step back13program.parse(['node', 'test', '--foo', '--bar', '--no-magic', '--camel-case', '--quux', 'value']);Merge pull request #262 from tonylukasavage/options_funcThomas Geraghtybefore adoption6089ed4
lines 14–21why, one step back14program.opts.should.be.a.Function;1516var opts = program.opts();17opts.should.be.an.Object;18opts.version.should.equal('0.0.1');19opts.foo.should.be.true;20opts.bar.should.be.true;21opts.magic.should.be.false;Merge pull request #353 from nkzawa/patch-0Randall Koutnikbefore adoption2120cb1
line 22why, one step back22opts.camelCase.should.be.true;Merge pull request #262 from tonylukasavage/options_funcThomas Geraghtybefore adoption6089ed4
line 23why, one step back23opts.quux.should.equal('value');