How to use the nomnom.option function in nomnom

To help you get started, we’ve selected a few nomnom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CommerceRack / anycommerce / utilities / nodesitemap / sitemap.js View on Github external
//
// SITEMAP GENERATOR
//


var fs = require('fs');
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;
var dateFormat = require('dateformat');
var now = new Date();

var opts = require('nomnom')
        .option('domain', {
                abbr: 'd',
                required : true,
                help : 'domain to generate a sitemap for'
                })
        .option('path', {
                abbr: 'p',
                default : './',
                help : 'path to write the file'
                })
		.option('customurls',{
				abbr:'c',
				default : false,
				help : 'path to json file containing an array of custom urls to be added to the sitemap'
				}).parse();
github mozilla / node-firefox-find-ports / bin / fx-ports.js View on Github external
var fs = require('fs');
var path = require('path');
var Table = require('cli-table');
var discoverPorts = require('../index');

var table = new Table({
  chars: { 'top': '' , 'top-mid': '' , 'top-left': '' , 'top-right': ''
         , 'bottom': '' , 'bottom-mid': '' , 'bottom-left': '' , 'bottom-right': ''
         , 'left': '' , 'left-mid': '' , 'mid': '' , 'mid-mid': ''
         , 'right': '' , 'right-mid': '' , 'middle': ' ' },
  style: { 'padding-left': 0, 'padding-right': 4 }
});

var types = {b2g: "Firefox OS", firefox:"Firefox Desktop"};

var opts = require("nomnom")
  .option('version', {
    flag: true,
    help: 'Print version and exit',
    callback: function() {
      fs.readFile(path.resolve(__dirname, '../package.json'), 'utf-8', function(err, file) {
        console.log(JSON.parse(file).version);
      });
    }
  })
  .option('b2g', {
    flag: true,
    help: 'Show Boot2Gecko (FirefoxOS) listening ports only'
  })
  .option('release', {
    list: true,
    help: 'Release of FirefoxOS to filter',
github CSUFTitanRover / TitanRover2018 / homebase / servers / tileserver / main.js View on Github external
#!/usr/bin/env node

'use strict';

var fs = require('fs'),
  path = require('path'),
  request = require('request');

var mbtiles = require('@mapbox/mbtiles');

var packageJson = require('tileserver-gl-light/package');

var opts = require('nomnom')
  .option('mbtiles', {
    default: undefined,
    help: 'MBTiles file (uses demo configuration);\n' +
      '\t    ignored if the configuration file is also specified',
    position: 0
  })
  .option('config', {
    abbr: 'c',
    default: 'config.json',
    help: 'Configuration file'
  })
  .option('bind', {
    abbr: 'b',
    default: undefined,
    help: 'Bind address'
  })
github micooz / wallpaper / lib / cli-wrapper.js View on Github external
#!/usr/bin/env node
'use strict';

var wallpaper = require('./wallpaper.js');
var logger = require('./utils/logger.js');

var opts = require('nomnom')
  .option('help', {
    abbr: 'h',
    help: 'show help information.'
  }).option('style', {
    abbr: 's',
    help: 'the wallpaper style[Tile, Center, Stretch, Fit, Fill], Windows Only.',
    default: 'Stretch'
  }).option('source', {
    help: 'the wallpaper source, support imageset[bing, ...] (see lib/sources/) OR uri',
    default: 'bing'
  }).parse();

wallpaper.set(opts, function (err) {
  if (!err) {
    logger.info('your wallpaper have been set successfully.');
  } else {
github digitarald / firewatch / lib / index.js View on Github external
#!/usr/bin/env node

var clivas = require('clivas');
var exec = require('child_process').exec;

var opts = require('nomnom')
	.option('app', {
		abbr: 'a',
		help: 'Filter list to one app (regexp format)'
	})
	.option('throttle', {
		abbr: 't',
		default: 0,
		help: 'Throttling b2g-info polling'
	})
	.parse();

var filter = null;
if (opts.app) {
	filter = new RegExp(opts.app, 'i');
}

nomnom

Option parser with generated usage and commands

MIT
Latest version published 10 years ago

Package Health Score

50 / 100
Full package analysis