@render-ae86/ae86-command
v1.0.4
Published
符合ae86规范的相关脚手架命令的基类
Downloads
1
Readme
ae86-command
介绍
符合ae86规范的相关脚手架命令的基类
安装教程
npm i @render-ae86/ae86-command -D
使用说明
const {Ae86Command,Ae86Commander,Json,CommandType} = require("@render-ae86/ae86-command");
const program = new Ae86Commander();
class InitCommand extends Aeb6Command {
constructor(strs: string, options: Json, cmd: CommandType) {
super(strs, options, cmd)
}
init(): void {
// TODO
}
exec(): void {
// TODO
}
}
const initCommand = (strs: string, options: Json, cmd: CommandType) => {
return new InitCommand(strs, options, cmd)
}
program
.name('string-util')
.description('CLI to some JavaScript string utilities')
.version('0.8.0');
program.command('split')
.description('Split a string into substrings and display as an array')
.argument('<string>', 'string to split')
.option('--first', 'display just the first substring')
.option('-s, --separator <char>', 'separator character', ',')
.action(initCommand);
program.parse();