Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
names: ['delay'],
type: 'number',
env: 'DELAY',
help: 'Events handling delay (for temp setup)',
default: 0,
},
{
names: ['stupid'],
type: 'bool',
env: 'STUPID',
help: 'Enables wrong results producing',
default: false,
},
];
const parser = dashdash.createParser({ options });
/**
* @type {{
* ethProvider: string;
* walletPriv: string;
* enforcerAddr: string;
* delay: number;
* stupid: boolean;
* }}
*/
const cliArgs = parser.parse(process.argv);
if (cliArgs.help) {
console.log('Usage:');
console.log(parser.help({ includeEnv: true }).trimRight());
process.exit(0);
var su = require("suman-utils");
var _suman = global.__suman = (global.__suman || {});
require('../helpers/add-suman-global-properties');
var constants = require('../../config/suman-constants').constants;
var fatalRequestReply = require('../helpers/general').fatalRequestReply;
if (process.env.NPM_COLORS === 'no') {
process.argv.push('--no-color');
console.log(' => Suman child process setting itself to be color-free (--no-colors)');
}
var sumanOpts = _suman.sumanOpts = _suman.sumanOpts || JSON.parse(process.env.SUMAN_OPTS);
var suman_options_1 = require("../parse-cmd-line-opts/suman-options");
var childArgs = sumanOpts.child_arg || [];
if (childArgs.length) {
childArgs.unshift('foo');
childArgs.unshift('baz');
var opts = void 0, parser = dashdash.createParser({ options: suman_options_1.options });
try {
opts = parser.parse(childArgs);
}
catch (err) {
console.error(chalk.red(' => Suman command line options error:'), err.message);
console.error(' => Try "suman --help" or visit sumanjs.org');
process.exit(constants.EXIT_CODES.BAD_COMMAND_LINE_OPTION);
}
sumanOpts = _suman.sumanOpts = Object.assign(sumanOpts, opts);
}
var usingRunner = _suman.usingRunner = true;
var projectRoot = _suman.projectRoot = process.env.SUMAN_PROJECT_ROOT;
process.send = process.send || function (data) {
console.error(chalk.magenta('Suman warning:'));
console.error('process.send() was not originally defined in this process.');
console.error('(Perhaps we are using Istanbul?), we are logging the first argument to process.send() here => ');
const Interpreter = require("./interpreter"),
Scopes = require("./scope"),
fs = require("fs"),
dashdash = require("dashdash");
function die(message) {
console.warn(message);
process.exit(1);
}
var optParser = dashdash.createParser({
options: [
{
names:["help", "h"],
type: "bool",
help: "Print usage and exit"
},
{
names:["output", "o"],
type: "string",
help: "Output file",
helpArg: "FILE",
default: "entities.json"
},
{
names: ["check", "c"],
type: "bool",
import * as assert from "assert";
import * as fs from "fs";
import log from "../../logging";
import chalk from "chalk";
import {NLURunOpts} from "../run/cmd-line-opts";
import {EVCb, NluGlobalSettingsConf} from "../../index";
import options from "../run/cmd-line-opts";
const dashdash = require('dashdash');
import * as async from 'async';
import {handleConfigCLIOpt} from '../../utils';
const treeify = require('treeify');
const allowUnknown = process.argv.indexOf('--allow-unknown') > 0;
let opts: NLURunOpts, globalConf: NluGlobalSettingsConf, parser = dashdash.createParser({options, allowUnknown});
try {
opts = parser.parse(process.argv);
} catch (e) {
log.error(chalk.magenta('CLI parsing error:'), chalk.magentaBright.bold(e.message));
process.exit(1);
}
if (opts.help) {
let help = parser.help({includeEnv: true}).trimRight();
console.log('usage: nlu run [OPTIONS]\n'
+ 'options:\n'
+ help);
process.exit(0);
}
import {makeFindProjects} from "./find-matching-projects";
import alwaysIgnore from './init-ignore';
import alwaysIgnoreThese from "../../always-ignore";
import {mapPaths} from "../../map-paths-with-env-vars";
process.once('exit', code => {
log.info('Exiting with code:', code,'\n');
});
if (!root) {
log.error('Cannot find a project root given your current working directory:', chalk.magenta(cwd));
log.error(' => NLU could not find a package.json file within your cwd.');
process.exit(1);
}
let opts: NLUInitOpts, parser = dashdash.createParser({options});
try {
opts = parser.parse(process.argv);
} catch (e) {
log.error(chalk.magenta(' => CLI parsing error:'), chalk.magentaBright.bold(e.message));
process.exit(1);
}
if (opts.help) {
let help = parser.help({includeEnv: true}).trimRight();
console.log('usage: nlu init [OPTIONS]\n' + 'options:\n' + help);
process.exit(0);
}
let pkgJSON: any;
});
if (!root) {
log.error('Cannot find a project root given your current working directory:', chalk.magenta(cwd));
log.error(' => NLU could not find a package.json file within your cwd.');
process.exit(1);
}
const commands = [
'nlu run',
'nlu init',
'nlu add'
];
const allowUnknown = process.argv.indexOf('--allow-unknown') > 0;
let opts: any, parser = dashdash.createParser({options, allowUnknown});
try {
opts = parser.parse(process.argv);
} catch (e) {
log.error(chalk.magenta('CLI parsing error:'), chalk.magentaBright.bold(e.message));
log.warn(chalk.gray('Perhaps you meant to use on of these commands instead:', chalk.gray.bold(commands.join(', '))));
process.exit(1);
}
if (opts.version) {
if(opts.json){
stdio.log(npmLinkUpPkg.version);
}
else{
console.log(npmLinkUpPkg.version);
}
(function main() {
var log;
var opts;
var parser = dashdash.createParser({options: CLI_OPTIONS});
var server;
try {
opts = parser.parse(process.argv);
} catch (e) {
console.error('mount: error: %s', e.message);
process.exit(1);
}
if (opts.help) {
var help = parser.help({includeEnv: true}).trimRight();
console.log('usage: mount [OPTIONS]\n options:\n' + help);
process.exit(0);
}
log = bunyan.createLogger({
import {createTree} from '../../create-visual-tree';
import {getCleanMap} from '../../get-clean-final-map';
import {q} from '../../search-queue';
import npmLinkUpPkg = require('../../../package.json');
import {EVCb, NluMap, NLURunOpts} from "../../npmlinkup";
import {determineIfReinstallIsNeeded, getDevKeys, getProdKeys, validateConfigFile, validateOptions} from "../../utils";
//////////////////////////////////////////////////////////////////////////
process.once('exit', function (code) {
log.info('NLU is exiting with code:', code, '\n');
});
//////////////////////////////////////////////////////////////
let opts: NLURunOpts, parser = dashdash.createParser({options});
try {
opts = parser.parse(process.argv);
} catch (e) {
log.error(chalk.magenta(' => CLI parsing error:'), chalk.magentaBright.bold(e.message));
process.exit(1);
}
if (opts.help) {
let help = parser.help({includeEnv: true}).trimRight();
console.log('usage: nlu run [OPTIONS]\n'
+ 'options:\n'
+ help);
process.exit(0);
}
help: 'Optional. Set of characters to encode with'
},
{
names: ['base'],
type: 'number',
help: 'Optional. The base to encode/decode with'
},
{
names: ['length'],
type: 'number',
help: 'Optional. maximum length of encoded ouptut.'
}
];
var parser = dashdash.createParser({
allowUnknown: true,
options: options
});
function showHelp(opts) {
var help = parser.help({includeEnv: true}).trimRight();
console.log('usage: basen [action] [value] [OPTIONS]\n\n'
+ 'action: encode | decode\n'
+ 'value: Number or string to encode/decode\n'
+ 'options:\n'
+ help);
}
try {
var opts = parser.parse(process.argv);
#!/usr/bin/node
var dash = require('dashdash');
var repl = require('repl');
var URL = require('url');
var Path = require('path');
var chalk;
try {
chalk = require('chalk');
} catch(e) {
chalk = {};
['gray', 'red', 'green', 'red'].forEach(function(col) {
chalk[col] = function(str) { return str; };
});
}
var parser = dash.createParser({options: [
{
names: ['help', 'h'],
type: 'bool',
help: 'Print this help and exit.'
},
{
names: ['location', 'l'],
type: 'bool',
help: 'Sets only location without actually loading the page'
},
{
names: ['allow-file-access-from-file-urls', 'local-access'],
type: 'bool',
help: 'Allow local access from file uris - useful to do local xhr'
},
{