diff --git a/src/Lang/Str.resx b/src/Lang/Str.resx index 5db689d..e7be8a6 100644 --- a/src/Lang/Str.resx +++ b/src/Lang/Str.resx @@ -28,7 +28,7 @@ 输入文本为空 - 查找文件... + 查找文件 指定的路径“{0}”不存在 @@ -182,4 +182,18 @@ 查找 "{0}" 下所有git仓库目录... + + 演习模式, 不会真实修改文件! + + + 读取 + + + + 写入 + + + + 跳过 + \ No newline at end of file diff --git a/src/Program.cs b/src/Program.cs index 3e4e5fb..78b4cab 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -1,6 +1,7 @@ using System.Reflection; using System.Text; using Dot; +using Spectre.Console; Type[] LoadVerbs() { @@ -18,9 +19,8 @@ async Task Run(object args) var tool = ToolsFactory.Create(option); await tool.Run(); if (option!.KeepSession) { - Console.WriteLine(); - Console.WriteLine(Str.PressAnyKey); - Console.ReadKey(); + AnsiConsole.MarkupLine(Str.PressAnyKey); + AnsiConsole.Console.Input.ReadKey(true); } } @@ -33,7 +33,7 @@ try { await Parser.Default.ParseArguments(args, types).WithParsedAsync(Run); } catch (ArgumentException ex) { - Console.Error.WriteLine(ex.Message); + AnsiConsole.MarkupLine($"[red]{ex.Message}[/]"); return -1; } diff --git a/src/ToLf/Main.cs b/src/ToLf/Main.cs index e05ef03..a061a77 100644 --- a/src/ToLf/Main.cs +++ b/src/ToLf/Main.cs @@ -1,34 +1,25 @@ using System.Diagnostics.CodeAnalysis; +using Spectre.Console; namespace Dot.ToLf; -public sealed class Main : ToolBase