test.command.action.emptyOption.js
This file
Path
test/test.command.action.emptyOption.js
20 lines · 382 bytes · JavaScript
Last changed by
Merge pull request #728 from sorohan/masterTomoaki Abebefore adoptionf5abcdb
History of this fileTake it
Merge pull request #728 from sorohan/masterTomoaki Abebefore adoptionf5abcdb
lines 1–20why, one step back1/**2 * Module dependencies.3 */45var program = require('../')6 , should = require('should');78var val = "some cheese"9program10 .name('test')11 .command('mycommand')12 .option('-c, --cheese [type]', 'optionally specify the type of cheese')13 .action(function(cmd) {14 val = cmd.cheese;15 });1617program.parse(['node', 'test', 'mycommand', '--cheese', '']);1819val.should.equal('');20