How to use the script function from nomnom

Find comprehensive JavaScript nomnom.script code examples handpicked from public code repositorys.

6
7
8
9
10
11
12
13
14
15
var opts       = require('nomnom'),
    utils      = require('../lib/utils'),
    dynroute   = require('../dynroute'),
    configFile = process.env.HOME + '/.awsrc';

opts = opts.script('dynroute')
  .option('domain', {
    abbr     : 'd',
    required : true,
    help     : 'Domain(s) to update [required]',
fork icon6
star icon46
watch icon6

+ 13 other calls in file

11
12
13
14
15
16
17
18
19
20

/**
 * Initialize
 */
 updateNotifier();
 parser.script("sailor");

/**
 * version
 */
fork icon2
star icon44
watch icon5

+ 13 other calls in file

85
86
87
88
89
90
91
92
93
94

// Check pushing path.
if (!argv.script) {
  usage();
} else {
  var pushpath = argv.script;
}

// Command command.
var updating = false;
fork icon20
star icon25
watch icon0

5
6
7
8
9
10
11
12
13
14
var fs = require('fs-promise')
var path = require('path')
var nom = require('nomnom')
var cl = require('cl')

var opts = nom.script('rock')
  .option('version',  {help: 'Print version and exit.', flag: true, callback: function() { return require('../package.json').version }})
  .option('path',     {help: 'Output path of generated directory structure.', position: 0, required: true})
  .option('rock',     {help: 'The rock path or Github repo.', abbr: 'r', metavar: 'ROCK', required: true})
  .option('config',   {help: 'The config file. Defaults to ~/.rock/rock.conf.json', abbr: 'c', default: path.join(osenv.home(), '.rock', 'rock.conf.json')})
fork icon1
star icon14
watch icon4

+ 13 other calls in file

-1
fork icon10
star icon0
watch icon1

+ 11 other calls in file