esa-cli
Version:
A CLI for operating Alibaba Cloud ESA EdgeRoutine (Edge Functions).
28 lines (27 loc) • 837 B
JavaScript
import routineList from './list.js';
import routineDelete from './delete.js';
import t from '../../i18n/index.js';
let yargsIns;
const routineCommand = {
command: 'routine [script]',
describe: `🚀 ${t('routine_describe').d('Manage your routine')}`,
builder: (yargs) => {
yargsIns = yargs;
return yargs
.command(routineList)
.command(routineDelete)
.option('help', {
alias: 'h',
describe: t('common_help').d('Help'),
type: 'boolean',
default: false
})
.usage(`${t('common_usage').d('Usage')}: esa routine [list | delete]`);
},
handler: (argv) => {
if (yargsIns && (argv.help || argv._.length < 2)) {
yargsIns.showHelp('log');
}
}
};
export default routineCommand;