.demandCommand() .help() .parse();
// eslint-disable-next-line const run = () => yargs .version(cliVersion) .commandDir(COMMAND_DIR) .demandCommand() .help() .argv
yargs .usage('git cactus <command>') .demandCommand(1, 'You need to provide a cactus command') .command('cut [level]', 'cuts a release branch from origin/master', (yargs) => { yargs .positional('level', { choices: ['major', 'minor'], default: 'minor', describe: 'The level of the release' }); }, wrap(cactus.cutReleaseBranch)) .command('tag', 'tags a version on a release branch', () => {}, wrap(cactus.tagVersion)) .group(['upstream'], 'Git Options:') .option('upstream', { default: 'origin', describe: 'Upstream remote name'}) .example('git cactus cut', 'Cuts a new release branch (minor)') .example('git cactus tag', 'Tags a new version (patch)')
__awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { options.forEach(function (option) { var commandFunc = option.commandFunc, desc = option.desc, command = option.command, optsFunc = option.optsFunc; yargs.command(command, desc, optsFunc, commandFunc); }); yargs .usage('usage: diat <command> [<args>]') .options({ // global options }) .scriptName('diat') .help() .locale('en') .demandCommand() .strict() .parse(); return [2 /*return*/]; }); })
.demandCommand(1) .help("h") .alias("h", "help")
handler: argv => (command = 'disarm') }) .demandCommand(1, 1, 'You must specify a command (stay/away/disarm)') .option('u', { alias: 'username',
DataBase.connect(true) }) .demandCommand(1, "") .help("h") .alias("h", "help")
.demandCommand() .help() .parse();
__awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { options.forEach(function (option) { var commandFunc = option.commandFunc, desc = option.desc, command = option.command, optsFunc = option.optsFunc; yargs.command(command, desc, optsFunc, commandFunc); }); yargs .usage('usage: diat <command> [<args>]') .options({ // global options }) .scriptName('diat') .help() .locale('en') .demandCommand() .strict() .parse(); return [2 /*return*/]; }); })