esa-cli
Version:
A CLI for operating Alibaba Cloud ESA Functions and Pages.
29 lines (28 loc) • 867 B
JavaScript
import t from '../../i18n/index.js';
import routineDelete from './delete.js';
import routineList from './list.js';
let yargsIns;
const routineCommand = {
command: 'project [script]',
aliases: ['routine'],
describe: `🧭 ${t('routine_describe').d('Manage your project')}`,
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-cli project [list | delete]`);
},
handler: (argv) => {
if (yargsIns && (argv.help || argv._.length < 2)) {
yargsIns.showHelp('log');
}
}
};
export default routineCommand;