test.command.action.js
This file
Path
test/test.command.action.js
14 lines · 309 bytes · JavaScript
Last changed by
Merge pull request #313 from zhiyelee/codestyleZhiye Libefore adoption543e47f
History of this fileTake it
Merge pull request #270 from zhiyelee/fix-subCommandThomas Geraghtybefore adoption1b7df5c
lines 1–6why, one step back1var program = require('../')2 , should = require('should');34var val = false;5program6 .command('info [options]')Merge pull request #313 from zhiyelee/codestyleZhiye Libefore adoption543e47f
lines 7–10why, one step back7 .option('-C, --no-color', 'turn off color output')8 .action(function () {9 val = this.color;10 });Merge pull request #270 from zhiyelee/fix-subCommandThomas Geraghtybefore adoption1b7df5c
lines 11–14why, one step back1112program.parse(['node', 'test', 'info']);1314program.commands[0].color.should.equal(val);