diff --git a/code-format.cmd b/code-format.cmd index 82c9512..253fbb5 100644 --- a/code-format.cmd +++ b/code-format.cmd @@ -1,3 +1,3 @@ -dot trim-utf8-bom -dot remove-whitespace -dot convert-lf \ No newline at end of file +dot rm-bom +dot rm-blank +dot tolf \ No newline at end of file diff --git a/src/Convert2Lf/Option.cs b/src/Convert2Lf/Option.cs deleted file mode 100644 index 7f3384d..0000000 --- a/src/Convert2Lf/Option.cs +++ /dev/null @@ -1,4 +0,0 @@ -namespace Dot.Convert2Lf; - -[Verb("convert-lf", HelpText = nameof(Strings.ConvertEndOfLineToLF), ResourceType = typeof(Strings))] -public class Option : DirOption { } \ No newline at end of file diff --git a/src/DirOption.cs b/src/DirOption.cs index 62c3017..a86564a 100644 --- a/src/DirOption.cs +++ b/src/DirOption.cs @@ -2,10 +2,14 @@ namespace Dot; public class DirOption : IOption { - [Option('f', "filter", Required = false, HelpText = nameof(Strings.FileSearchPattern), Default = "*.*" + [Option('f', "filter", HelpText = nameof(Strings.FileSearchPattern), Default = "*.*" , ResourceType = typeof(Strings))] public string Filter { get; set; } [Value(0, HelpText = nameof(Strings.FolderPath), Default = ".", ResourceType = typeof(Strings))] public string Path { get; set; } + + + [Option('r', "readonly", HelpText = nameof(Strings.ReadOnly), Default = false, ResourceType = typeof(Strings))] + public bool ReadOnly { get; set; } } \ No newline at end of file diff --git a/src/Lang/Strings.Designer.cs b/src/Lang/Strings.Designer.cs index 2a141ff..b053a6d 100644 --- a/src/Lang/Strings.Designer.cs +++ b/src/Lang/Strings.Designer.cs @@ -113,15 +113,6 @@ namespace Dot.Lang { } } - /// - /// Looks up a localized string similar to 要处理的文本(默认取取剪贴板值). - /// - public static string HelpForTextArg0 { - get { - return ResourceManager.GetString("HelpForTextArg0", resourceCulture); - } - } - /// /// Looks up a localized string similar to 输入文本为空. /// @@ -131,6 +122,15 @@ namespace Dot.Lang { } } + /// + /// Looks up a localized string similar to 没有需要处理的文件. + /// + public static string NoFileToBeProcessed { + get { + return ResourceManager.GetString("NoFileToBeProcessed", resourceCulture); + } + } + /// /// Looks up a localized string similar to 指定的路径“{0}”不存在. /// @@ -140,6 +140,15 @@ namespace Dot.Lang { } } + /// + /// Looks up a localized string similar to 按下任意键继续.... + /// + public static string PressAnyKey { + get { + return ResourceManager.GetString("PressAnyKey", resourceCulture); + } + } + /// /// Looks up a localized string similar to BitSet 1:[0-9],2:[a-z],4:[A-Z],8:[ascii.0x21-0x2F]. /// @@ -167,6 +176,15 @@ namespace Dot.Lang { } } + /// + /// Looks up a localized string similar to 只读模式(仅做测试,不实际修改). + /// + public static string ReadOnly { + get { + return ResourceManager.GetString("ReadOnly", resourceCulture); + } + } + /// /// Looks up a localized string similar to 移除文件尾部换行和空格. /// @@ -186,7 +204,7 @@ namespace Dot.Lang { } /// - /// Looks up a localized string similar to 查找文件...OK. + /// Looks up a localized string similar to {0} 个文件. /// public static string SearchingFileOK { get { @@ -203,6 +221,15 @@ namespace Dot.Lang { } } + /// + /// Looks up a localized string similar to 要处理的文本(默认取取剪贴板值). + /// + public static string TextTobeProcessed { + get { + return ResourceManager.GetString("TextTobeProcessed", resourceCulture); + } + } + /// /// Looks up a localized string similar to 移除文件的uf8 bom. /// diff --git a/src/Lang/Strings.en-US.resx b/src/Lang/Strings.en-US.resx new file mode 100644 index 0000000..d9d42b0 --- /dev/null +++ b/src/Lang/Strings.en-US.resx @@ -0,0 +1,86 @@ + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + The input text is empty + + + Find files... + + + The specified path "{0}" does not exist + + + Find files...OK + + + Read: {0}/{1}, processed: {2}, skipped: {3} + + + Text encoding tool + + + {0}(copied to clipboard) + + + File wildcards + + + Directory path to be processed + + + Convert newline characters to LF + + + GUID tool + + + Use uppercase output + + + Random password generator + + + Password length + + + BitSet 1:[0-9],2:[a-z],4:[A-Z],8:[ascii.0x21-0x2F] + + + Remove line breaks and spaces at the end of the file + + + Remove the uf8 bom of the file + + + Text to be processed (clipboard value is taken by default) + + + Press any key to continue... + + + Read-only mode (only for testing, no actual modification) + + + No documents to be processed + + \ No newline at end of file diff --git a/src/Lang/Strings.resx b/src/Lang/Strings.resx index 7dc2879..49467fb 100644 --- a/src/Lang/Strings.resx +++ b/src/Lang/Strings.resx @@ -34,7 +34,7 @@ 指定的路径“{0}”不存在 - 查找文件...OK + {0} 个文件 已读取:{0}/{1},处理:{2},跳过:{3} @@ -42,7 +42,7 @@ 文本编码工具 - + 要处理的文本(默认取取剪贴板值) @@ -82,4 +82,13 @@ 移除文件的uf8 bom + + 按下任意键继续... + + + 只读模式(仅做测试,不实际修改) + + + 没有需要处理的文件 + \ No newline at end of file diff --git a/src/RemoveTrailingWhiteSpace/Option.cs b/src/RemoveTrailingWhiteSpace/Option.cs deleted file mode 100644 index 4a4ee03..0000000 --- a/src/RemoveTrailingWhiteSpace/Option.cs +++ /dev/null @@ -1,4 +0,0 @@ -namespace Dot.RemoveTrailingWhiteSpace; - -[Verb("remove-whitespace", HelpText = nameof(Strings.RemoveTrailingWhiteSpaces), ResourceType = typeof(Strings))] -public class Option : DirOption { } \ No newline at end of file diff --git a/src/RemoveTrailingWhiteSpace/Main.cs b/src/RmBlank/Main.cs similarity index 82% rename from src/RemoveTrailingWhiteSpace/Main.cs rename to src/RmBlank/Main.cs index becca13..d1af5bc 100644 --- a/src/RemoveTrailingWhiteSpace/Main.cs +++ b/src/RmBlank/Main.cs @@ -1,7 +1,7 @@ using System.Diagnostics.CodeAnalysis; using NSExt.Extensions; -namespace Dot.RemoveTrailingWhiteSpace; +namespace Dot.RmBlank; public sealed class Main : Tool