Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// 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
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;
#!/usr/bin/env node
var argv = require('optimist')
.boolean(['x','y','z'])
.argv
;
console.dir([ argv.x, argv.y, argv.z ]);
console.dir(argv._);
#!/usr/bin/env node
var argv = require('optimist')
.boolean(['x','y','z'])
.argv
;
console.dir([ argv.x, argv.y, argv.z ]);
console.dir(argv._);
#!/usr/bin/env node
var argv = require('optimist')
.boolean(['x','y','z'])
.argv
;
console.dir([ argv.x, argv.y, argv.z ]);
console.dir(argv._);
#!/usr/bin/env node
var argv = require('optimist')
.boolean('v')
.argv
;
console.dir(argv.v);
console.dir(argv._);
#!/usr/bin/env node
var argv = require('optimist')
.boolean(['x','y','z'])
.argv
;
console.dir([ argv.x, argv.y, argv.z ]);
console.dir(argv._);
#!/usr/bin/env node
var argv = require('optimist')
.boolean(['x','y','z'])
.argv
;
console.dir([ argv.x, argv.y, argv.z ]);
console.dir(argv._);
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
}
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;