mirror of
https://github.com/nsnail/dot.git
synced 2025-06-19 22:08:16 +08:00
<feat> v1.0.1 + guid工具
This commit is contained in:
17
src/Guid/Main.cs
Normal file
17
src/Guid/Main.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using TextCopy;
|
||||
|
||||
namespace Dot.Guid;
|
||||
|
||||
public sealed class Main : Tool<Option>
|
||||
{
|
||||
public Main(Option opt) : base(opt) { }
|
||||
|
||||
|
||||
public override void Run()
|
||||
{
|
||||
var guid = System.Guid.NewGuid().ToString();
|
||||
if (Opt.Upper) guid = guid.ToUpper();
|
||||
ClipboardService.SetText(guid);
|
||||
Console.WriteLine($"已复制到剪贴板:{guid}");
|
||||
}
|
||||
}
|
8
src/Guid/Option.cs
Normal file
8
src/Guid/Option.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace Dot.Guid;
|
||||
|
||||
[Verb("guid", HelpText = "GUID工具")]
|
||||
public class Option : IOption
|
||||
{
|
||||
[Option('u', "upper", HelpText = "大写", Default = false)]
|
||||
public bool Upper { get; set; } //normal options here
|
||||
}
|
Reference in New Issue
Block a user