mirror of
https://github.com/nsnail/dot.git
synced 2025-06-18 05:23:21 +08:00
<feat> v1.0.1 + guid工具
This commit is contained in:
parent
a9fb5dba38
commit
d3af9c3bcc
@ -1,3 +1,3 @@
|
|||||||
do.exe trim-utf8-bom
|
dot trim-utf8-bom
|
||||||
do.exe remove-whitespace
|
dot remove-whitespace
|
||||||
do.exe convert-lf
|
dot convert-lf
|
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
|
||||||
|
}
|
@ -3,6 +3,6 @@ namespace Dot.Text;
|
|||||||
[Verb("text", HelpText = "文本编码工具")]
|
[Verb("text", HelpText = "文本编码工具")]
|
||||||
public class Option : IOption
|
public class Option : IOption
|
||||||
{
|
{
|
||||||
[Value(1, MetaName = "文本", HelpText = "要处理的文本,不指定此参数:取剪贴板值")]
|
[Value(0, MetaName = "文本", HelpText = "要处理的文本,不指定此参数:取剪贴板值")]
|
||||||
public string Text { get; set; }
|
public string Text { get; set; }
|
||||||
}
|
}
|
@ -12,6 +12,7 @@ public static class ToolsFactory
|
|||||||
, RemoveTrailingWhiteSpace.Option o => new RemoveTrailingWhiteSpace.Main(o)
|
, RemoveTrailingWhiteSpace.Option o => new RemoveTrailingWhiteSpace.Main(o)
|
||||||
, Random.Option o => new Random.Main(o)
|
, Random.Option o => new Random.Main(o)
|
||||||
, Text.Option o => new Text.Main(o)
|
, Text.Option o => new Text.Main(o)
|
||||||
|
, Guid.Option o => new Guid.Main(o)
|
||||||
, _ => throw new ArgumentOutOfRangeException(nameof(option))
|
, _ => throw new ArgumentOutOfRangeException(nameof(option))
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<RootNamespace>Dot</RootNamespace>
|
<RootNamespace>Dot</RootNamespace>
|
||||||
<AssemblyName>dot</AssemblyName>
|
<AssemblyName>dot</AssemblyName>
|
||||||
<Version>1.0.0</Version>
|
<Version>1.0.1</Version>
|
||||||
<Authors>nsnail</Authors>
|
<Authors>nsnail</Authors>
|
||||||
<Copyright>Copyright (c) 2022 nsnail</Copyright>
|
<Copyright>Copyright (c) 2022 nsnail</Copyright>
|
||||||
<RepositoryUrl>https://github.com/nsnail/dot.git</RepositoryUrl>
|
<RepositoryUrl>https://github.com/nsnail/dot.git</RepositoryUrl>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user