diff --git a/test/test.command.action.emptyOption.js b/test/test.command.action.emptyOption.js new file mode 100644 index 000000000..33276754f --- /dev/null +++ b/test/test.command.action.emptyOption.js @@ -0,0 +1,20 @@ +/** + * 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(''); +