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
123456789101112131415161718192021/** * Module dependencies. */
var program = require('../') , should = require('should');
var val = "some cheese"program .name('test') .command('mycommand') .option('-c, --cheese [type]', 'optionally specify the type of cheese') .action(function(cmd) { val = cmd.cheese; });
program.parse(['node', 'test', 'mycommand', '--cheese', '']);
val.should.equal('');