Skip to content

Commit b3870ee

Browse files
committed
fix(cli): help menu typo
1 parent c7d243b commit b3870ee

1 file changed

Lines changed: 26 additions & 17 deletions

File tree

file_classification_cli/src/bin/file_classification_cli.rs

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -517,41 +517,45 @@ fn handle_simplified_command(
517517

518518
fn print_help() {
519519
println!("可用命令:");
520-
println!(" file create --type <type> --path <path> --group_id <id> 创建文件");
520+
println!(" file create --type <type> --path <path> --group-id <id> 创建文件");
521521
println!(" file delete --id <id> 删除文件");
522522
println!(" file list-interactive 交互式查询文件");
523523
println!(" file list-by-conditions -c <conditions...> 按条件查询文件");
524-
println!(" file list-by-group-id --group_id <id> 按组ID查询文件");
524+
println!(" file list-by-group-id --group-id <id> 按组ID查询文件");
525525
println!(" file update-by-conditions -c <conditions...> 按条件更新文件");
526526
println!(" file delete-by-conditions -c <conditions...> 按条件删除文件");
527527
println!(" group create --name <name> 创建组");
528528
println!(" group delete --id <id> 删除组");
529529
println!(" group list-interactive 交互式查询组");
530530
println!(" group list-by-conditions -c <conditions...> 按条件查询组");
531-
println!(" group list-by-file-id --file_id <id> 按文件ID查询组");
532-
println!(" group list-by-tag-id --tag_id <id> 按标签ID查询组");
531+
println!(" group list-by-file-id --file-id <id> 按文件ID查询组");
532+
println!(" group list-by-tag-id --tag-id <id> 按标签ID查询组");
533533
println!(" group update-by-conditions -c <conditions...> 按条件更新组");
534534
println!(" group delete-by-conditions -c <conditions...> 按条件删除组");
535535
println!(" tag create --name <name> 创建标签");
536536
println!(" tag delete --id <id> 删除标签");
537537
println!(" tag list-interactive 交互式查询标签");
538538
println!(" tag list-by-conditions -c <conditions...> 按条件查询标签");
539-
println!(" tag list-by-group-id --group_id <id> 按组ID查询标签");
539+
println!(" tag list-by-group-id --group-id <id> 按组ID查询标签");
540540
println!(" tag update-by-conditions -c <conditions...> 按条件更新标签");
541541
println!(" tag delete-by-conditions -c <conditions...> 按条件删除标签");
542-
println!(" file-group create --file_id <id> --group_id <id> 创建文件-组关联");
543-
println!(" file-group delete --id <id> 删除文件-组关联");
542+
println!(" file-group create --file-id <id> --group-id <id> 创建文件-组关联");
543+
println!(" file-group delete --file-id <id> --group-id <id> 删除文件-组关联");
544+
println!(" file-group list-interactive 交互式查询文件-组关联");
544545
println!(" file-group list-by-conditions -c <conditions...> 按条件查询文件-组关联");
545-
println!(" group-tag create --group_id <id> --tag_id <id> 创建组-标签关联");
546-
println!(" group-tag delete --id <id> 删除组-标签关联");
546+
println!(" file-group delete-by-conditions -c <conditions...> 按条件删除文件-组关联");
547+
println!(" group-tag create --group-id <id> --tag-id <id> 创建组-标签关联");
548+
println!(" group-tag delete --group-id <id> --tag-id <id> 删除组-标签关联");
549+
println!(" group-tag list-interactive 交互式查询组-标签关联");
547550
println!(" group-tag list-by-conditions -c <conditions...> 按条件查询组-标签关联");
551+
println!(" group-tag delete-by-conditions -c <conditions...> 按条件删除组-标签关联");
548552
println!("");
549553
println!("简化命令:");
550554
println!(" ls 列出当前上下文相关的项目");
551-
println!(" cd <id> 切换当前上下文");
552-
println!(" select <type> <id> 选择特定类型和ID");
553-
println!(" new <type> <name/path> 快速创建新项目");
554-
println!(" rm <type> <id> 快速删除项目");
555+
println!(" cd <id> 切换当前上下文(假定为组)");
556+
println!(" select <type> <id> 选择特定类型和ID (type: file/group/tag)");
557+
println!(" new <type> <name/path> 快速创建新项目 (type: file/group/tag)");
558+
println!(" rm <type> <id> 快速删除项目 (type: file/group/tag)");
555559
println!(" context 显示当前上下文");
556560
println!(" clear 清屏");
557561
println!(" !<command> 执行系统命令");
@@ -2050,7 +2054,6 @@ fn parse_group_tag_order_by(args: &[String]) -> Vec<models::GroupTagOrderBy> {
20502054
order_bys
20512055
}
20522056

2053-
// 交互式查询函数(示例)
20542057
fn list_files_interactive(conn: &mut AnyConnection, context: &mut Context) {
20552058
use file_classification_core::service::files as file_service;
20562059
use dialoguer::{Select, theme::ColorfulTheme};
@@ -2064,9 +2067,10 @@ fn list_files_interactive(conn: &mut AnyConnection, context: &mut Context) {
20642067
return;
20652068
}
20662069

2070+
// 修改这里:显示完整的文件信息
20672071
let items: Vec<String> = files
20682072
.iter()
2069-
.map(|f| format!("[{}] {}", f.id, f.path))
2073+
.map(|f| format!("[{}] 类型: {}, 路径: {}, 组ID: {}", f.id, f.type_, f.path, f.group_id))
20702074
.collect();
20712075

20722076
let selection = Select::with_theme(&ColorfulTheme::default())
@@ -2102,9 +2106,11 @@ fn list_groups_interactive(conn: &mut AnyConnection, context: &mut Context) {
21022106
return;
21032107
}
21042108

2109+
// 修改这里:显示完整的组信息
21052110
let items: Vec<String> = groups
21062111
.iter()
2107-
.map(|g| format!("[{}] {}", g.id, g.name))
2112+
.map(|g| format!("[{}] 名称: {}, 引用数: {}, 主要组: {}, 点击数: {}, 分享数: {}",
2113+
g.id, g.name, g.reference_count, g.is_primary, g.click_count, g.share_count))
21082114
.collect();
21092115

21102116
let selection = Select::with_theme(&ColorfulTheme::default())
@@ -2140,9 +2146,10 @@ fn list_tags_interactive(conn: &mut AnyConnection, context: &mut Context) {
21402146
return;
21412147
}
21422148

2149+
// 修改这里:显示完整的标签信息
21432150
let items: Vec<String> = tags
21442151
.iter()
2145-
.map(|t| format!("[{}] {}", t.id, t.name))
2152+
.map(|t| format!("[{}] 名称: {}, 引用数: {}", t.id, t.name, t.reference_count))
21462153
.collect();
21472154

21482155
let selection = Select::with_theme(&ColorfulTheme::default())
@@ -2178,6 +2185,7 @@ fn list_file_groups_interactive(conn: &mut AnyConnection, context: &mut Context)
21782185
return;
21792186
}
21802187

2188+
// 修改这里:显示完整的文件组关联信息
21812189
let items: Vec<String> = file_groups
21822190
.iter()
21832191
.map(|fg| format!("文件 ID: {}, 组 ID: {}", fg.file_id, fg.group_id))
@@ -2220,6 +2228,7 @@ fn list_group_tags_interactive(conn: &mut AnyConnection, context: &mut Context)
22202228
return;
22212229
}
22222230

2231+
// 修改这里:显示完整的组标签关联信息
22232232
let items: Vec<String> = group_tags
22242233
.iter()
22252234
.map(|gt| format!("组 ID: {}, 标签 ID: {}", gt.group_id, gt.tag_id))

0 commit comments

Comments
 (0)