yargs.version(() => { return pkgJSON.version }) .alias('version', 'v') .describe('version', 'Show version information')
require('yargs') .usage('npm run configure -- <arguments>') .describe('p', 'The panel url to pull the configuration from') .alias('p', 'panel-url') .describe('t', 'The configuration token') .alias('t', 'token') .boolean('o') .describe('o', 'Overwrite existing configuration file') .alias('o', 'overwrite') .alias('h', 'help') .check(checkParams) .help('h') .fail((msg, err, yargs) => { console.error(err.message); console.log(yargs.help()); process.exit(1); })
(function(j){ yargs = yargs.default(pd[j].name, pd[j].initial).describe(pd[j].name, pd[j].caption) })(i);
parseCommandLine() { let options = this._yargs(process.argv).default('windowsize','800x600').wrap(100); options.usage('Electron command line'); options.alias('ws', 'windowsize').string('ws').describe('ws','set window size (Ex: 800x600)'); options.alias('d', 'debug').boolean('1').describe('1', 'Autostart dev tools'); options.alias('u', 'userdata').string('u').describe('u', 'set userdata directory'); options.alias('v', 'version').boolean('v').describe('v', 'Print the version.'); options.alias('h', 'help').boolean('h').describe('h', 'Print this usage message.'); this._args = options.argv; if (this._args.help) { process.stdout.write(options.help()); process.exit(0); } if (this._args.version) { process.stdout.write(`Electron Version : ${process.versions.electron}\n`); process.stdout.write('GLBrowser Version : 0.0.1\n'); process.exit(0); } }
require('yargs') .command('* <file-path>', 'parse and convert the input file', (yargs) => { yargs.positional('file-path', { describe: 'the input USFM or JSON file to be parsed and converted', }); }) .alias('l', 'level') .describe('l', 'specify the level of strictness in parsing') .choices('l', ['relaxed']) .describe('filter', 'filters out only the specific contents from input USFM') .choices('filter', ['scripture']) .describe('format', 'specifies the output file format') .choices('format', ['csv', 'tsv', 'usfm', 'json']) .alias('o', 'output') .describe('o', 'specify the fully qualified file path for output.') .alias('h', 'help') .alias('v', 'version') .help('help')
.default('port', 9900) .alias('p', 'port') .describe('port', 'The port used to accept incoming connections') .number('pubPort') .default('pubPort', 9901) .alias('P', 'pubPort') .describe('pubPort', 'The port used to publish signals to all the workers') .string('alphabet') .default('alphabet', isv.defaultAlphabet) .alias('a', 'alphabet') .describe('alphabet', 'The alphabet used to generate the passwords') .number('batchSize') .alias('b', 'batchSize') .default('batchSize', 1000000) .describe('batchSize', 'The number of attempts assigned to every client in a batch') .number('start') .alias('s', 'start') .describe('start', 'The index from where to start the search') .default('start', 0) .help()
.describe('companyName', 'company name of the account') .argv;