How to use the _ function from yargs
Find comprehensive JavaScript yargs._ code examples handpicked from public code repositorys.
GitHub: eduardo-costa/web-bundle
42 43 44 45 46 47 48 49 50 51
return command === 'ls' || command === 'decode' || command === 'encode'; }) .argv; var command = argv._.shift(), files = argv._; switch(command) { case 'ls': ls(files, argv);
21
363
19
+ 7 other calls in file
38 39 40 41 42 43 44 45 46 47
var fail = 0; var failures = []; var genStack = []; var pathspec = argv._.length>0 ? argv._[0] : '../openapi-directory/APIs/'; var options = argv; var widdershinsOptions = {}; widdershinsOptions.sample = true;
55
304
220
+ 3 other calls in file
30 31 32 33 34 35 36 37 38 39
var base = path.normalize(path.join(path.dirname(require.resolve('../lib/index.js')), '..')); child_process.execFileSync('make', [ 'enclave', 'SCRIPTS=' + argv._.map(function (script) {return path.resolve(script);}).join(' '), 'ENCLAVE_KEY=' + path.resolve(argv.key), 'ENCLAVE_CONFIG=' + path.resolve(argv.config), 'ENCLAVE_OUTPUT=' + path.resolve(argv.output) ], {
17
96
20
+ 5 other calls in file
GitHub: ntblk/block-crawler
84 85 86 87 88 89 90 91
axios.get('https://api.ipify.org') .then(res => { externalIP = res.data; }).then(() => { console.log("External IP: " + externalIP); argv._.forEach(url => bc.queue(url)); bc.start(); });
18
33
0
GitHub: lando/cli
9 10 11 12 13 14 15 16 17 18
const log = new Log({logLevelConsole: 'debug', logName: 'yaml2json'}); const path = require('path'); const yaml = require('yaml'); // Get file args const inputFiles = argv._; // Get options const outputDir = path.resolve(argv.outputDir || process.cwd()); // If no files then print some basic usage shit
35
30
4
136 137 138 139 140 141 142 143 144 145
} } process.exitCode = 1; if ((!argv._.length) && (!argv.fail)) { argv._.push('.'); } for (var pathspec of argv._) { processPathSpec(pathspec, false); }
17
27
4
19 20 21 22 23 24 25 26 27 28
describe: 'Log about the process', }) .demandCommand(3) .argv; const [idsPath, inPath, outPath] = argv._; function log(message) { if (argv.verbose) { console.log(message);
10
16
0
+ 3 other calls in file
GitHub: HaikuTeam/animator
32 33 34 35 36 37 38 39 40 41
const inputs = lodash.assign({}, DEFAULTS, argv); delete inputs._; delete inputs.$0; // List of arguments following the command const args = argv._; const branch = cp.execSync('git symbolic-ref --short -q HEAD || git rev-parse --short HEAD').toString().trim(); log.log(`fyi, your current branch is ${JSON.stringify(branch)}\n`); if (!inputs.branch) {
132
0
43
+ 17 other calls in file
GitHub: Esri/esri-leaflet-bundler
32 33 34 35 36 37 38 39
.version(function () { return require('../package.json').version; }) .argv; args.entry = args._.pop(); bundler(args);
4
2
8
GitHub: gmarty/xgettext
70 71 72 73 74 75 76 77 78 79
if (encodings.indexOf(argv['from-code']) < 0) { throw new Error(`${pkg.name}: encoding of input files must be either utf8, ascii or base64`); } if (!argv['files-from'] && argv._.length === 0) { return pkg.name + ': no input file given'; } return true;
35
79
7
+ 5 other calls in file
GitHub: developmentseed/vt-geojson
57 58 59 60 61 62 63 64 65 66
if (argv.testargs) { console.log(argv) process.exit() } var uri = argv._.shift() if (!/^[^\/]*\:\/\//.test(uri)) { if (/mbtiles$/.test(uri)) { uri = 'mbtiles://' + path.resolve(uri) } else if (!process.env.MapboxAccessToken) {
13
60
56
28 29 30 31 32 33 34 35 36
const uglify = require('gulp-uglify'); const watchify = require('watchify'); const production = !!argv.production; const build = argv._.length ? argv._[0] === 'build' : false; const watch = argv._.length ? argv._[0] === 'watch' : true; const reload = browserSync.reload;
0
0
1
+ 5 other calls in file
yargs.argv is the most popular function in yargs (1012 examples)