From a77ba1966b058e90898c0d30b0fa59a4c98e4a85 Mon Sep 17 00:00:00 2001 From: nsnail Date: Wed, 7 Dec 2022 23:24:42 +0800 Subject: [PATCH] =?UTF-8?q?=20+=20tolf:=20=E5=86=99=E5=85=A5?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=BF=A1=E6=81=AF=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code-cleanup-on-save.csx | 1 + code-format.cmd | 6 +++--- src/DirOption.cs | 4 ++-- src/Lang/Str.en-US.resx | 25 ++++++++++++++++++++----- src/Lang/Str.resx | 9 ++++++--- src/RmBlank/Main.cs | 2 +- src/RmBom/Main.cs | 2 +- src/ToLf/Main.cs | 36 ++++++++++++++++++++++-------------- 8 files changed, 56 insertions(+), 29 deletions(-) diff --git a/code-cleanup-on-save.csx b/code-cleanup-on-save.csx index 7e67684..4f47674 100644 --- a/code-cleanup-on-save.csx +++ b/code-cleanup-on-save.csx @@ -8,4 +8,5 @@ var path = Directory.GetFiles(@".idea", "workspace.xml", SearchOption.AllDirecto """; var content = File.ReadAllText(path); content = content.Replace(findStr, replaceStr); + Console.WriteLine(content); File.WriteAllText(path, content); \ No newline at end of file diff --git a/code-format.cmd b/code-format.cmd index 253fbb5..2a4cd3e 100644 --- a/code-format.cmd +++ b/code-format.cmd @@ -1,3 +1,3 @@ -dot rm-bom -dot rm-blank -dot tolf \ No newline at end of file +dot rm-bom -w +dot rm-blank -w +dot tolf -w \ No newline at end of file diff --git a/src/DirOption.cs b/src/DirOption.cs index 46acf25..a71933f 100644 --- a/src/DirOption.cs +++ b/src/DirOption.cs @@ -9,6 +9,6 @@ public class DirOption : OptionBase public string Path { get; set; } - [Option('r', "readonly", HelpText = nameof(Str.ReadOnly), Default = false, ResourceType = typeof(Str))] - public bool ReadOnly { get; set; } + [Option('w', "write", HelpText = nameof(Str.WriteMode), Default = false, ResourceType = typeof(Str))] + public bool WriteMode { get; set; } } \ No newline at end of file diff --git a/src/Lang/Str.en-US.resx b/src/Lang/Str.en-US.resx index 075b05b..f03a9fc 100644 --- a/src/Lang/Str.en-US.resx +++ b/src/Lang/Str.en-US.resx @@ -1,4 +1,4 @@ - + @@ -74,9 +74,6 @@ Press any key to continue... - - Read-only mode (only for testing, no actual modification) - No documents to be processed @@ -173,4 +170,22 @@ Json text escaped into a string - \ No newline at end of file + + Enable write mode + + + Read-only mode, the file will not be modified in real time! + + + read + + + write + + + skip + + + Write statistics + + diff --git a/src/Lang/Str.resx b/src/Lang/Str.resx index e7be8a6..4fc22a6 100644 --- a/src/Lang/Str.resx +++ b/src/Lang/Str.resx @@ -137,8 +137,8 @@ 按下任意键继续... - - 只读模式(仅做测试,不实际修改) + + 启用写入模式 没有需要处理的文件 @@ -183,7 +183,7 @@ 查找 "{0}" 下所有git仓库目录... - 演习模式, 不会真实修改文件! + 只读模式, 不会真实修改文件! 读取 @@ -196,4 +196,7 @@ 跳过 + + 写入统计 + \ No newline at end of file diff --git a/src/RmBlank/Main.cs b/src/RmBlank/Main.cs index f2e7be4..d78471c 100644 --- a/src/RmBlank/Main.cs +++ b/src/RmBlank/Main.cs @@ -35,7 +35,7 @@ public sealed class Main : ToolBase