How to use the optimist.string function in optimist

To help you get started, we’ve selected a few optimist 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 fossasia / susper.com / node_modules / protractor / built / cli.js View on Github external
explorer: 'elementExplorer'
    },
    strings: { 'capabilities.tunnel-identifier': '' }
};
optimist.usage('Usage: protractor [configFile] [options]\n' +
    'configFile defaults to protractor.conf.js\n' +
    'The [options] object will override values from the config file.\n' +
    'See the reference config for a full list of options.');
for (let key of Object.keys(optimistOptions.describes)) {
    optimist.describe(key, optimistOptions.describes[key]);
}
for (let key of Object.keys(optimistOptions.aliases)) {
    optimist.alias(key, optimistOptions.aliases[key]);
}
for (let key of Object.keys(optimistOptions.strings)) {
    optimist.string(key);
}
optimist.check(function (arg) {
    if (arg._.length > 1) {
        throw new Error('Error: more than one config file specified');
    }
});
let argv = optimist.parse(args);
if (argv.help) {
    optimist.showHelp();
    process.exit(0);
}
if (argv.version) {
    console.log('Version ' + require(path.resolve(__dirname, '../package.json')).version);
    process.exit(0);
}
// Check to see if additional flags were used.
github sx1989827 / DOClever / node_modules / handlebars / node_modules / uglify-js / node_modules / optimist / example / string.js View on Github external
#!/usr/bin/env node
var argv = require('optimist')
    .string('x', 'y')
    .argv
;
console.dir([ argv.x, argv.y ]);

/* Turns off numeric coercion:
    ./node string.js -x 000123 -y 9876
    [ '000123', '9876' ]
*/
github arei / npmbox / npmbox.js View on Github external
// npmbox by Glen R. Goodwin (@areinet)
// https://github.com/arei/npmbox.git

// Creates an archive "box" of one or more npm packages and their dependencies.

"use strict";

var boxxer = require("./npmboxxer.js");

var argv = require("optimist")
	.string([
		"proxy",
		"https-proxy"
	])
	.boolean(["v","verbose","s","silent"])
	.options("t", {
		alias: "target",
		default: null
	})
	.argv;

var args = argv._;
if (args.length<1 || argv.help) {
	console.log("npmbox - Create an archive for offline installation of the given package.");
	console.log("");
	console.log("Usage: ");
github jooby-project / jooby / jooby-assets-svg-sprites / src / main / resources / dr-svg-sprites / node_modules / handlebars / node_modules / optimist / example / string.js View on Github external
#!/usr/bin/env node
var argv = require('optimist')
    .string('x', 'y')
    .argv
;
console.dir([ argv.x, argv.y ]);

/* Turns off numeric coercion:
    ./node string.js -x 000123 -y 9876
    [ '000123', '9876' ]
*/
github appcelerator / titanium_mobile / node_modules / node-appc / node_modules / optimist / example / string.js View on Github external
#!/usr/bin/env node
var argv = require('optimist')
    .string('x', 'y')
    .argv
;
console.dir([ argv.x, argv.y ]);

/* Turns off numeric coercion:
    ./node string.js -x 000123 -y 9876
    [ '000123', '9876' ]
*/
github jsuarez5341 / neural-mmo-client / LegacyWebClient / node_modules / optimist / example / string.js View on Github external
#!/usr/bin/env node
var argv = require('optimist')
    .string('x', 'y')
    .argv
;
console.dir([ argv.x, argv.y ]);

/* Turns off numeric coercion:
    ./node string.js -x 000123 -y 9876
    [ '000123', '9876' ]
*/
github chrislennon / Crypto-Touchbar-App / node_modules / optimist / example / string.js View on Github external
#!/usr/bin/env node
var argv = require('optimist')
    .string('x', 'y')
    .argv
;
console.dir([ argv.x, argv.y ]);

/* Turns off numeric coercion:
    ./node string.js -x 000123 -y 9876
    [ '000123', '9876' ]
*/
github tbranyen / backbone-boilerplate / build / tasks / mincss / node_modules / clean-css / node_modules / optimist / examples / string.js View on Github external
#!/usr/bin/env node
var argv = require('optimist')
    .string('x', 'y')
    .argv
;
console.dir([ argv.x, argv.y ]);

/* Turns off numeric coercion:
    ./node string.js -x 000123 -y 9876
    [ '000123', '9876' ]
*/
github udaiarora / WebRTC-Video_Conference / 0 TO BE DELETED / To_Heroku / node_modules / node-static / node_modules / optimist / example / string.js View on Github external
#!/usr/bin/env node
var argv = require('optimist')
    .string('x', 'y')
    .argv
;
console.dir([ argv.x, argv.y ]);

/* Turns off numeric coercion:
    ./node string.js -x 000123 -y 9876
    [ '000123', '9876' ]
*/
github ezpaarse-project / ezpaarse / node_modules / forever / node_modules / flatiron / lib / flatiron / plugins / cli.js View on Github external
exports.argv = function (options) {
  var optimist = require('optimist').string('_');

  if (options && Object.keys(options).length) {
    optimist = optimist.options(options);
    this.showOptions = optimist.help;
    this.argv = optimist.argv;
  }
  else {
    this.showOptions = optimist.help;
    this.argv = optimist.argv;
  }
};