This commit is contained in:
2022-12-02 17:58:45 +08:00
parent 507b0aec5b
commit c09644c9c1
24 changed files with 384 additions and 443 deletions

View File

@ -7,11 +7,12 @@ public sealed class Main : Tool<Option>
public Main(Option opt) : base(opt) { }
public override void Run()
public override Task Run()
{
var guid = System.Guid.NewGuid().ToString();
if (Opt.Upper) guid = guid.ToUpper();
ClipboardService.SetText(guid);
Console.WriteLine(Strings.Copied, guid);
Console.WriteLine(Str.Copied, guid);
return Task.CompletedTask;
}
}

View File

@ -1,8 +1,8 @@
namespace Dot.Guid;
[Verb("guid", HelpText = nameof(Strings.GuidTool), ResourceType = typeof(Strings))]
[Verb("guid", HelpText = nameof(Str.GuidTool), ResourceType = typeof(Str))]
public class Option : IOption
{
[Option('u', "upper", HelpText = nameof(Strings.UseUppercase), Default = false, ResourceType = typeof(Strings))]
[Option('u', "upper", HelpText = nameof(Str.UseUppercase), Default = false, ResourceType = typeof(Str))]
public bool Upper { get; set; } //normal options here
}