38 lines
1.5 KiB
TypeScript
38 lines
1.5 KiB
TypeScript
/**
|
|
* commands/app/index.ts — app 父命令
|
|
*
|
|
* JNPF 多 app 生命周期 (appCenter + appConfig/*)
|
|
*
|
|
* 子命令 (v0.9 命名规范化: 顶层 login/status/switchapp/initapp 全部归入 app):
|
|
* list 列出所有应用
|
|
* info 应用详情
|
|
* create 真·创建 JNPF 应用
|
|
* init 应用初始化 (健康检查 / 重启; 原 initapp)
|
|
* clear 清除应用本地资源 + DB (破坏性, TTY + 双确认, 移植自 Java 版)
|
|
* login 登录 JNPF (原顶层 login)
|
|
* status 显示登录状态 (原顶层 status)
|
|
* switch 切换当前应用 (原顶层 switchapp / switch-app)
|
|
*/
|
|
import { Command } from 'commander'
|
|
import { buildAppListCommand } from './list.ts'
|
|
import { buildAppInfoCommand } from './info.ts'
|
|
import { buildAppInitCommand } from './init.ts'
|
|
import { buildAppCreateCommand } from './create.ts'
|
|
import { buildAppClearCommand } from './clear.ts'
|
|
import { buildAppLoginCommand } from './login.ts'
|
|
import { buildAppStatusCommand } from './status.ts'
|
|
import { buildAppSwitchCommand } from './switch.ts'
|
|
|
|
export function buildAppCommand(): Command {
|
|
const cmd = new Command('app').description('应用 (JNPF 多 app 生命周期, appCenter)')
|
|
cmd.addCommand(buildAppListCommand())
|
|
cmd.addCommand(buildAppInfoCommand())
|
|
cmd.addCommand(buildAppInitCommand())
|
|
cmd.addCommand(buildAppCreateCommand())
|
|
cmd.addCommand(buildAppClearCommand())
|
|
cmd.addCommand(buildAppLoginCommand())
|
|
cmd.addCommand(buildAppStatusCommand())
|
|
cmd.addCommand(buildAppSwitchCommand())
|
|
return cmd
|
|
}
|