How to use the optimist.boolean 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 apache / couchdb / src / couchjs-node / cli.js View on Github external
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.

var fs = require('fs');
var Fiber = require('fibers');
var optimist = require('optimist');

var couchjs = require('./couchjs');
var package_json = require('./package.json');
var LineStream = require('./stream');
var inspector = require('./inspector');
var log = require('./console').log;


var opts = optimist.boolean(['h', 'V', 'H'])
                   .describe({ 'h': 'display a short help message and exit',
                             'V': 'display version information and exit',
                             'H': 'enable couchjs cURL bindings (not implemented)'
                             })
                   .usage('$0 
github plasma-umass / doppio / console / coverage.ts View on Github external
process.stderr.write = stderr_write;
    if (test_classes.length === 0) {
      return callback();
    }
    var test = test_classes.shift();
    quiet || stdout("running " + test + "...\n");
    jvm_state.reset_classloader_cache();
    // Quiet standard output.
    process.stdout.write = nop;
    process.stderr.write = nop;
    return jvm_state.run_class(test, [], _runner);
  }
}

var print = require('util').print;
var optimist = require('optimist')
  .boolean(['n', 'o', 'q', 'h'])
  .alias({
    n: 'natives',
    o: 'opcodes',
    q: 'quiet',
    p: 'print-usage',
    h: 'help'
  }).describe({
    n: 'Cover native functions',
    o: 'Cover opcodes',
    q: 'Suppress in-progress output',
    p: 'Print all usages, not just unused',
    h: 'Show usage'
  }).usage('Usage: $0 [class_file(s)]');

var argv = optimist.argv;
github No9 / harmon / node_modules / http-proxy / node_modules / optimist / example / boolean_double.js View on Github external
#!/usr/bin/env node
var argv = require('optimist')
    .boolean(['x','y','z'])
    .argv
;
console.dir([ argv.x, argv.y, argv.z ]);
console.dir(argv._);
github jamesshore / automatopia / node_modules / karma / node_modules / optimist / example / boolean_double.js View on Github external
#!/usr/bin/env node
var argv = require('optimist')
    .boolean(['x','y','z'])
    .argv
;
console.dir([ argv.x, argv.y, argv.z ]);
console.dir(argv._);
github aikar / timings / node_modules / optimist / example / boolean_double.js View on Github external
#!/usr/bin/env node
var argv = require('optimist')
    .boolean(['x','y','z'])
    .argv
;
console.dir([ argv.x, argv.y, argv.z ]);
console.dir(argv._);
github MarcDiethelm / xtc / node_modules / convict / node_modules / optimist / example / boolean_single.js View on Github external
#!/usr/bin/env node
var argv = require('optimist')
    .boolean('v')
    .argv
;
console.dir(argv.v);
console.dir(argv._);
github flikore / writerstrail / node_modules / jade / node_modules / optimist / example / boolean_double.js View on Github external
#!/usr/bin/env node
var argv = require('optimist')
    .boolean(['x','y','z'])
    .argv
;
console.dir([ argv.x, argv.y, argv.z ]);
console.dir(argv._);
github BlueSpire / Durandal / src / weyland / node_modules / uglify-js / node_modules / optimist / example / boolean_double.js View on Github external
#!/usr/bin/env node
var argv = require('optimist')
    .boolean(['x','y','z'])
    .argv
;
console.dir([ argv.x, argv.y, argv.z ]);
console.dir(argv._);
github iriscouch / fastcgi / cli.js View on Github external
function get_argv() {
  OPTS = optimist.boolean(['die', 'daemon'])
                 .demand(['port', 'socket'])
                 .default({ 'max': 25
                         })
                 .describe({ 'die': 'Exit after serving one request'
                           , 'log': 'Path to log file'
                           , 'port': 'Listening port number'
                           , 'max': 'Maximum allowed subprocesses'
                           , 'daemon': 'Daemonize (run in the background); requires --log and --pidfile'
                           , 'pidfile': 'Lockfile to use when daemonizing'
                           , 'socket': 'Unix socket FastCGI program will use'
                          })
                 .usage('Usage: $0 [options]  [program arg1] [arg2] [...]')

  ARGV = OPTS.argv
}
github ionic-team / ionic-app-lib / lib / cordova.js View on Github external
var chalk = require('chalk');
var argv = require('optimist').boolean(['nohooks', 'n', 'r', 'noresources', 'nosave', 'e']).argv;
var cordova = require('cordova-lib').cordova.raw;
var exec = require('child_process').exec;
var State = require('./state');
var Q = require('q');
var log = require('./logging').logger;

var Cordova = module.exports;

Cordova.Lib = require('cordova-lib');

Cordova.runCordova = function runCordova(cmdName) {
  var deferred = Q.defer();
  var self = this;
  var cmdArgs = (process.argv.length > 3 ? process.argv.slice(3) : []);
  var cmdArg;
  var x;