program .version(version, '-v, --version', 'print version') .usage('[options] <files>') .option('-l, --list-browsers', 'list (effective or --all) browsers') .option('-a, --all', 'test or list all available browsers') .option('-c, --concurrency <n>', 'number of browsers to test concurrently, default 5') .option('-r, --retries <retries>', 'number of retries when running a browser, default 6') .option('-t, --timeout <timeout>', 'how long to wait for test results, default 5m') .option('--coverage', 'enable code coverage analysis') .option('--live', 'keep browsers open to allow repeated test runs') .option('-p, --preset <preset>', 'select a configuration preset') .option('-s, --server <script>', 'path to script that runs a support server') .option('--loopback <hostname>', 'custom hostname that equals or resolves to 127.0.0.1') .option('--verbose', 'enable airtap debug output') .option('--silly', 'enable all debug output') // Can we hide these in help? .option('--local', 'n/a') .option('--open', 'n/a') .option('--electron', 'n/a') .on('--help', function () { console.log() console.log(read('examples.txt')) }) .parse(process.argv)
_commander.option('-d, --download <URL>', 'Download From URL, Can Be Multiple URL With Comma "https://zippy...,https://zippy"', a => { a = a.split(',') if (a.length > 1) { _async.eachSeries(a, (a, b) => { exports.DLFunc(a.trim(), b) }, (err, res) => { console.log(`Batch Download Done`) }) } else { exports.DLFunc(a[0], () => { }) } })
_commander.option('-l, --link <URL>', 'Only Get URL Download File, For Now Only Support Single URL', async a => { const res = await exports.GetLink(a) if (res.error) { console.log(_colors.bgRed(_colors.white(' ' + res.message + ' '))) return null } else { console.log('🔥 ' + _colors.green('URL Download : ') + _colors.yellow(res.url)) _clipboard.writeSync(res.url) console.log('📋 ' + _colors.green('URL Has Copy On Your Clipboard')) } })
function parseArgs() { program .option('--host <value>', 'host') .parse(process.argv); assert(/^(\d+\.\d+\.\d+\.\d+):(\d+)$/.test(program.host)); }
_commander.option('-b, --batch <FILE>', 'Get URL Download From File', (a) => { if (!_fs.existsSync(a)) { console.log(_colors.bgRed.white(` File ${a} Not Found `)); } else { let file = _fs.readFileSync(a, 'utf8') file = file.split(/\r\n|\r|\n/) _async.eachSeries(file, (a, b) => { exports.DLFunc(a.trim(), b) }, (err, res) => { console.log(`Batch Download Done`) }) } })
function parseArgs() { program .option('--scenario <value>', 'path to scenario relative to scenario runner') .option('--cycles [value]', 'number of cycles', parseInt, 10) .option('--workers [value]', 'number of workers', parseInt, 10) .parse(process.argv); assert(program.scenario, 'path to scenario should be provided'); console.log('configuration:'); console.log('- scenario', program.scenario); console.log('- cycles', program.cycles); console.log('- workers', program.workers); }
start(process) { try { const runInInteractiveMode = this._isRunningInInteractiveMode(); const commandMetadataList = this._commandsMetadataService.getCommandsMetadata(); this._initializeCommands(commandMetadataList, runInInteractiveMode); // If there are no arguments, we print SuiteCloud version header if (!process.argv || process.argv.length <= 2) { NodeConsoleLogger.info(NodeTranslationService.getMessage(TITLE, COMPATIBLE_NS_VERSION)); } program .version(CLI_VERSION, '--version') .option(`${INTERACTIVE_ALIAS}, ${INTERACTIVE_OPTION}`, NodeTranslationService.getMessage(INTERACTIVE_OPTION_DESCRIPTION)) .on('command:*', args => { NodeConsoleLogger.error(NodeTranslationService.getMessage(ERRORS.COMMAND_DOES_NOT_EXIST, args[0])); }) .usage(NodeTranslationService.getMessage(USAGE)) .parse(process.argv); } catch (exception) { NodeConsoleLogger.error(unwrapExceptionMessage(exception)); } }
.usage("option") .description(github.description()) .option( "-u, --username <username>", "Github username for which to list andculture repositories"
function initCli () { cli .option('-b, --boring', 'Don\'t show TWLY picture on run') .option('-c, --chars [integer]', 'Minimum number of characters a block must have to be compared') .option('-f, --files [glob]', 'Files you would like to analyze', '**/*.*') .option('-l, --lines [integer]', 'Minimum number of lines a block must have to be compared') .option('-t, --trc [string]', 'Path to TWLY config file') .option('-T, --threshold [integer or floating point]', 'Specify the point at which you would like Towelie to fail') .parse(process.argv); // Length of three indicates only one arg passed, which we assume is a glob let glob = process.argv.length === 3 ? process.argv[2] : cli.files; let runtimeConf = { files: glob }; if (!cli.boring) { console.log(chalk.green(require('./assets/towelie'))); } // CLI arguments take precedence over config file, since they are "closer" to runtime if (cli.threshold) { runtimeConf.threshold = cli.threshold; } if (cli.lines) { runtimeConf.minLines = cli.lines; } if (cli.chars) { runtimeConf.minChars = cli.chars; } if (cli.trc) { runtimeConf.trc = cli.trc; } run(runtimeConf); }
/** * configure input options */ function initialize() { program .version('1.5.8') .option('-i, --ignorecase', 'Ignore case distinctions') .option('-t, --extension <items>', 'Filter by custom types ex: ".app,.jar,.exe"') .option('-R, --rec', 'Recurse into subdirectories') .option('-x, --text [text]', 'Find text or /regex/ in files') .option('-w, --word [word]', 'Force PATTERN to match only whole words or /regex/ (file name)') .option('-v, --invert', 'Invert match: select non-matching lines') .option('--ignore-dir <items>', 'Ignore directories') .option('--ignore-file <items>', 'Ignore files') .option('--ignore-ext <items>', 'Ignore extensions') .option('--sort', 'Sort the found files'); //dynamic generate options Object.keys(typeList).forEach(function(type) { program.option('--' + type, 'filter ' + type + ' files'); }); program.parse(process.argv); checkParams(); }
function parseArgs() { program .option('--host <value>', 'host') .parse(process.argv); assert(/^(\d+\.\d+\.\d+\.\d+):(\d+)$/.test(program.host)); }
function parseArgs() { program .option('--scenario <value>', 'path to scenario relative to scenario runner') .option('--cycles [value]', 'number of cycles', parseInt, 10) .option('--workers [value]', 'number of workers', parseInt, 10) .parse(process.argv); assert(program.scenario, 'path to scenario should be provided'); console.log('configuration:'); console.log('- scenario', program.scenario); console.log('- cycles', program.cycles); console.log('- workers', program.workers); }
start(process) { try { const runInInteractiveMode = this._isRunningInInteractiveMode(); const commandMetadataList = this._commandsMetadataService.getCommandsMetadata(); this._initializeCommands(commandMetadataList, runInInteractiveMode); // If there are no arguments, we print SuiteCloud version header if (!process.argv || process.argv.length <= 2) { NodeConsoleLogger.info(NodeTranslationService.getMessage(TITLE, COMPATIBLE_NS_VERSION)); } program .version(CLI_VERSION, '--version') .option(`${INTERACTIVE_ALIAS}, ${INTERACTIVE_OPTION}`, NodeTranslationService.getMessage(INTERACTIVE_OPTION_DESCRIPTION)) .on('command:*', args => { NodeConsoleLogger.error(NodeTranslationService.getMessage(ERRORS.COMMAND_DOES_NOT_EXIST, args[0])); }) .usage(NodeTranslationService.getMessage(USAGE)) .parse(process.argv); } catch (exception) { NodeConsoleLogger.error(unwrapExceptionMessage(exception)); } }