mirror of
https://github.com/nsnail/dot.git
synced 2025-06-19 13:58:16 +08:00
<refactor>
This commit is contained in:
@ -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)
|
||||
|
@ -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; }
|
||||
}
|
Reference in New Issue
Block a user