/** * Returns a parsed array of CLI arguments and options * * @since 3.0.0 * @alias lando.cli.argv * @return {Object} Yarg parsed options * @example * const argv = lando.cli.argv(); * @todo make this static and then fix all call sites */ argv() { return require('yargs').help(false).version(false).argv; }
yargonaut.style('green').errorsStyle('red'); const yargs = require('yargs'); const {clear, channel, experimental, secretToggle} = yargs.argv;
.command("build [configPath]", "Build project", (yarg) => { return yarg .positional("configPath", { type: "string", default: process.cwd(), describe: "The path where expressvue.config.js lives", }) .coerce("configPath", (arg) => { return path.join(process.cwd(), arg); }) .option("verbose", { alias: "v", default: false, .help()
.usage('$0 <cmd> [args]') .command('new <model_file> <name> [-t tags]]', 'Upload and publish a tflite model', (yargs) => { yargs.positional('model_file', { describe: 'Path to a tflite model', type: 'string' }); yargs.positional('name', { describe: 'Display name for the model', type: 'string' }); yargs.option('tags', { alias: 't', demandOption: false, }); }) .command('list [-f filter-exp]', 'List the models in your project.\n\nFor information about the ' + 'filter language, see\n' + 'https://firebase.google.com/docs/ml-kit/manage-hosted-models#list_your_projects_models', (yargs) => { yargs.option('filter', { alias: 'f', demandOption: false, }); })
yargs .option('path', { alias: 'p', required: true, coerce: input => path.resolve('./', input) })
yargs.command( 'alias <command> <domain>', 'Run alias step with custom command', {}, ({ command, domain }) => { alias(() => exec(command), domain); } );
function handler(argv) { if (argv.prepare) { return release(PREPARE, argv); } else if (argv.promote) { return release(PROMOTE, argv); } // If more than one action is provided or no valid action // is provided, show help. yargs.showHelp(); }
yargs.parse(args, (err, argv, output) => { TerminalUtils.verbose(argv) if (argv.promisedResult) { TerminalUtils.verbose('Waiting for async command to complete...') argv.promisedResult.catch(handleError).then(onComplete) } else { if (err) { handleError(err) } onComplete(output) } })
detectLocale() { const yargs = require('yargs') const locale = yargs.locale() try { this._existsLocaleFile(locale) } catch (e) { // eslint-disable-line return 'en' } return locale }
yargs .usage('vbot <-f> | vbot download <--client-key> <--scenario-id>') .command('$0', 'run vbot test from local json file', (yargs) => { return yargs.demandOption(['f']) }) .command('download', 'run vbot test stored in vbot web', (yargs) => { return yargs .option('client-key', {demand: true}) .option('scenario-id', {demand: true}) })
.usage('$0 <cmd> [args]') .command('new <model_file> <name> [-t tags]]', 'Upload and publish a tflite model', (yargs) => { yargs.positional('model_file', { describe: 'Path to a tflite model', type: 'string' }); yargs.positional('name', { describe: 'Display name for the model', type: 'string' }); yargs.option('tags', { alias: 't', demandOption: false, }); }) .command('list [-f filter-exp]', 'List the models in your project.\n\nFor information about the ' + 'filter language, see\n' + 'https://firebase.google.com/docs/ml-kit/manage-hosted-models#list_your_projects_models', (yargs) => { yargs.option('filter', { alias: 'f', demandOption: false, }); })