fix(cli): resolve all command name duplication issues
CLI命令重复修复完成(18个命令): - interface模块:ssh-start, web-start, webdav-start, iscsi-start, iscsi-stop, iscsi-status - metadata模块:db-create, db-status, db-backup, db-restore, user-create, user-list, user-show, user-delete, config-show - storage模块:archive-decompress, archive-list, sync-start, sync-status, mount-attach, mount-detach, mount-list - interface/tree模块:tree-create, tree-list, tree-import, tree-delete, tree-folder-create, tree-folder-delete, tree-folder-rename 根本原因: - 所有CLI子模块使用 #[command(flatten)] 导致命令名冲突 - 修复方法:添加 #[command(name = "module-command")] 属性 测试结果: - ✅ 编译成功(150 warnings, 0 errors) - ✅ CLI命令列表正确(所有命令在顶层命名空间) - ✅ SSH服务器启动成功(port 2024) - ✅ SSH版本交换测试通过(SSH-2.0-MarkBaseSSH_1.0) 影响范围: - 13个CLI文件修改 - 18个命令添加唯一命名属性 - CLI结构从 interface/metadata/storage/tools 四层变为扁平化单层
This commit is contained in:
@@ -4,20 +4,24 @@ use anyhow::Context;
|
||||
|
||||
#[derive(Subcommand)]
|
||||
pub enum DbCommand {
|
||||
#[command(name = "db-create")]
|
||||
Create {
|
||||
#[arg(short, long)]
|
||||
user: String,
|
||||
},
|
||||
#[command(name = "db-status")]
|
||||
Status {
|
||||
#[arg(short, long)]
|
||||
user: String,
|
||||
},
|
||||
#[command(name = "db-backup")]
|
||||
Backup {
|
||||
#[arg(short, long)]
|
||||
user: String,
|
||||
#[arg(short, long)]
|
||||
output: String,
|
||||
},
|
||||
#[command(name = "db-restore")]
|
||||
Restore {
|
||||
#[arg(short, long)]
|
||||
user: String,
|
||||
|
||||
Reference in New Issue
Block a user