Sha256: a3f7ec5b454f0e6695be30237a4871b292850d6a1295cb65406351c880c571b3

Contents?: true

Size: 895 Bytes

Versions: 9

Compression:

Stored size: 895 Bytes

Contents

var nomnom = require("../nomnom");

var parser = nomnom()
   .option('debug', {
      abbr: 'x',
      flag: true,
      help: 'Print debugging info'
   })
   .option('config', {
      abbr: 'c',
      default: 'config.json',
      help: 'JSON file with tests to run'
   })
   .option('version', {
      flag: true,
      help: 'print version and exit',
      callback: function() {
         return "version 1.2.4";
      }
   });


exports.testOption = function(test) {
   var opts = parser.parse(["-x", "--no-verbose"]);

   test.strictEqual(opts.debug, true);
   test.equal(opts.config, "config.json");
   test.done();
}


exports.testCommandOption = function(test) {
   var parser = nomnom()
   parser.command('test')
     .option('fruit', {
        abbr: 'f',
        flag: true
     })

   var opts = parser.parse(["test", "-f"]);

   test.strictEqual(opts.fruit, true);
   test.done();
}

Version data entries

9 entries across 7 versions & 4 rubygems

Version Path
locomotivecms-4.0.0.alpha1 app/javascript/node_modules/nearley/node_modules/nomnom/test/option.js
locomotivecms-4.0.0.alpha1 app/javascript/node_modules/nomnom/test/option.js
locomotivecms-3.4.0 app/javascript/node_modules/nearley/node_modules/nomnom/test/option.js
locomotivecms-3.4.0 app/javascript/node_modules/nomnom/test/option.js
dragonfly_puppeteer-0.1.0 node_modules/nomnom/test/option.js
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/nomnom/test/option.js
xcodebuild-helper-1.2.3 externals/ios-sim-master/node_modules/nomnom/test/option.js
spider-src-0.1.7 lib/spider-src/support/spider/node_modules/nomnom/test/option.js
spider-src-0.1.6 lib/spider-src/support/spider/node_modules/spider-script/node_modules/nomnom/test/option.js