<refactor>

This commit is contained in:
2022-12-01 11:26:41 +08:00
parent 8b1265b832
commit 85944f23b4
20 changed files with 391 additions and 86 deletions

View File

@ -28,7 +28,7 @@ public sealed class Main : Tool<Option>
public Main(Option opt) : base(opt)
{
if (Opt.Text.NullOrEmpty()) Opt.Text = ClipboardService.GetText();
if (Opt.Text.NullOrEmpty()) throw new ArgumentException("输入文本为空");
if (Opt.Text.NullOrEmpty()) throw new ArgumentException(Strings.InputTextIsEmpty);
}
private static Output BuildOutput(string text, Encoding enc)

View File

@ -1,8 +1,8 @@
namespace Dot.Text;
[Verb("text", HelpText = "文本编码工具")]
[Verb("text", HelpText = nameof(Strings.HelpForText), ResourceType = typeof(Strings))]
public class Option : IOption
{
[Value(0, MetaName = "文本", HelpText = "要处理的文本,不指定此参数:取剪贴板值")]
[Value(0, HelpText = nameof(Strings.HelpForTextArg0), ResourceType = typeof(Strings))]
public string Text { get; set; }
}