How to use the optimist.default 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 deathcap / wsmc / wsmc.js View on Github external
'use strict';

var mcversion = require('./mcversion.js');
var minecraft_protocol = require('minecraft-protocol/src');
var autoVersionForge = require('minecraft-protocol-forge').autoVersionForge;
var minecraft_data = require('minecraft-data')(mcversion);
var protodef = require('protodef');
var readVarInt = protodef.types.varint[0];
var writeVarInt = protodef.types.varint[1];
var sizeOfVarInt = protodef.types.varint[2];
var hex = require('hex');
var WebSocketServer = (require('ws')).Server;
var websocket_stream = require('websocket-stream');
var argv = (require('optimist'))
  .default('wshost', '')
  .default('wsport', 24444)
  .default('mchost', 'localhost')
  .default('mcport', 25565)
  .default('prefix', 'webuser-')
  .argv;

var PACKET_DEBUG = process.env.NODE_DEBUG && /wsmc/.test(process.env.NODE_DEBUG);
var FIXED_MC_VERSION = false; // either a version string, or false to auto-detect

console.log('WS('+argv.wshost+':'+argv.wsport+') <--> MC('+argv.mchost+':'+argv.mcport+')');

var ids = minecraft_data.protocol.states.play.toClient;
var sids = minecraft_data.protocol.states.play.toServer;
github adobe-photoshop / generator-core / app.js View on Github external
_logStream = new logging.StreamFormatter(_loggerManager),
        _logger = _loggerManager.createLogger("app");

    // For backwards compatibility, set the logStream on the generator object
    // even though I believe the only place this was previously referenced was in this file
    generator.logStream = _logStream;

    // On Windows, the bullet character is sometimes replaced with the bell character BEL (0x07).
    // This causes Windows to make a beeping noise every time • is printed to the console.
    // Use · instead. This needs to happen before adding stdlog to not affect the log files.
    if (process.platform === "win32") {
        utils.filterWriteStream(process.stdout, utils.replaceBullet);
        utils.filterWriteStream(process.stderr, utils.replaceBullet);
    }

    var optionParser = optimist["default"]({
        "p" : 49494,
        "h" : "127.0.0.1",
        "P" : "password",
        "i" : null,
        "o" : null,
        "f" : null,
        "photoshopVersion": null,
        "photoshopPath": null,
        "photoshopBinaryPath": null,
        "photoshopLogPath": null,
        "whiteListedPlugins": null
    });

    var argv = optionParser
        .usage("Run generator service.\nUsage: $0")
        .describe({
github volkanceylan / Serenity / References / node / node_modules / uglify-js / node_modules / optimist / example / default_hash.js View on Github external
#!/usr/bin/env node

var argv = require('optimist')
    .default({ x : 10, y : 10 })
    .argv
;

console.log(argv.x + argv.y);
github flikore / writerstrail / node_modules / jade / node_modules / optimist / example / default_hash.js View on Github external
#!/usr/bin/env node

var argv = require('optimist')
    .default({ x : 10, y : 10 })
    .argv
;

console.log(argv.x + argv.y);
github diy / opensourcerer.diy.org / node_modules / optimist / example / default_singles.js View on Github external
#!/usr/bin/env node
var argv = require('optimist')
    .default('x', 10)
    .default('y', 10)
    .argv
;
console.log(argv.x + argv.y);
github sx1989827 / DOClever / node_modules / optimist / example / default_singles.js View on Github external
#!/usr/bin/env node
var argv = require('optimist')
    .default('x', 10)
    .default('y', 10)
    .argv
;
console.log(argv.x + argv.y);
github ornl-sava / nv / node_modules / optimist / example / default_hash.js View on Github external
#!/usr/bin/env node

var argv = require('optimist')
    .default({ x : 10, y : 10 })
    .argv
;

console.log(argv.x + argv.y);
github cdapio / cdap / tools / node_modules / groc / node_modules / optimist / examples / default_hash.js View on Github external
#!/usr/bin/env node

var argv = require('optimist')
    .default({ x : 10, y : 10 })
    .argv
;

console.log(argv.x + argv.y);