@@ -345,7 +345,7 @@ fn handle_simplified_command(line: &str, conn: &mut AnyConnection, context: &mut
345345 if let Ok ( cmd) = Cli :: try_parse_from ( args) {
346346 let _ = handle_command ( cmd, conn, context) ;
347347 }
348-
348+
349349 println ! ( "列出组ID {} 相关的标签:" , group_id) ;
350350 let group_id_str = group_id. to_string ( ) ;
351351 let args = vec ! [ "tag" , "list-by-group-id" , "--group_id" , & group_id_str] ;
@@ -378,7 +378,7 @@ fn handle_simplified_command(line: &str, conn: &mut AnyConnection, context: &mut
378378 println ! ( "错误: 无效的ID" ) ;
379379 return true ;
380380 }
381-
381+
382382 // 尝试确定ID类型并设置上下文
383383 // 简单实现: 假设是组ID
384384 context. selected_file_id = None ;
@@ -392,13 +392,13 @@ fn handle_simplified_command(line: &str, conn: &mut AnyConnection, context: &mut
392392 println ! ( "错误: 用法 select <type> <id>" ) ;
393393 return true ;
394394 }
395-
395+
396396 let id = parts[ 2 ] . parse :: < i32 > ( ) . unwrap_or ( 0 ) ;
397397 if id <= 0 {
398398 println ! ( "错误: 无效的ID" ) ;
399399 return true ;
400400 }
401-
401+
402402 match parts[ 1 ] {
403403 "file" => {
404404 context. selected_file_id = Some ( id) ;
@@ -429,7 +429,7 @@ fn handle_simplified_command(line: &str, conn: &mut AnyConnection, context: &mut
429429 println ! ( "错误: 用法 new <type> <name/path>" ) ;
430430 return true ;
431431 }
432-
432+
433433 match parts[ 1 ] {
434434 "group" => {
435435 let args = vec ! [ "group" , "create" , "--name" , parts[ 2 ] ] ;
@@ -466,13 +466,13 @@ fn handle_simplified_command(line: &str, conn: &mut AnyConnection, context: &mut
466466 println ! ( "错误: 用法 rm <type> <id>" ) ;
467467 return true ;
468468 }
469-
469+
470470 let id = parts[ 2 ] . parse :: < i32 > ( ) . unwrap_or ( 0 ) ;
471471 if id <= 0 {
472472 println ! ( "错误: 无效的ID" ) ;
473473 return true ;
474474 }
475-
475+
476476 match parts[ 1 ] {
477477 "file" => {
478478 let args = vec ! [ "file" , "delete" , "--id" , parts[ 2 ] ] ;
@@ -659,16 +659,16 @@ fn handle_command(command: Cli, conn: &mut AnyConnection, context: &mut Context)
659659 let mut script_file = File :: open ( & file) ?;
660660 let mut content = String :: new ( ) ;
661661 script_file. read_to_string ( & mut content) ?;
662-
662+
663663 println ! ( "执行脚本: {}" , file) ;
664664 for line in content. lines ( ) {
665665 let line = line. trim ( ) ;
666666 if line. is_empty ( ) || line. starts_with ( '#' ) {
667667 continue ; // 跳过空行和注释
668668 }
669-
669+
670670 println ! ( "执行命令: {}" , line) ;
671-
671+
672672 // 尝试解析为标准命令
673673 let args: Vec < & str > = line. split_whitespace ( ) . collect ( ) ;
674674 if let Ok ( cmd) = Cli :: try_parse_from ( args) {
0 commit comments