mirror of
https://github.com/nsnail/dot.git
synced 2025-06-19 13:58:16 +08:00
<refactor> 移除 https://github.com/commandlineparser/commandline.git
This commit is contained in:
@ -2,6 +2,8 @@ using System.Net.Sockets;
|
||||
|
||||
namespace Dot.Time;
|
||||
|
||||
[Description(nameof(Str.TimeTool))]
|
||||
[Localization(typeof(Str))]
|
||||
public sealed class Main : ToolBase<Option>
|
||||
{
|
||||
private const int _MAX_DEGREE_OF_PARALLELISM = 10;
|
||||
@ -31,9 +33,6 @@ public sealed class Main : ToolBase<Option>
|
||||
private int _successCnt;
|
||||
|
||||
|
||||
public Main(Option opt) : base(opt) { }
|
||||
|
||||
|
||||
private TimeSpan GetNtpOffset(string server)
|
||||
{
|
||||
Span<byte> ntpData = stackalloc byte[48];
|
||||
|
@ -1,11 +1,17 @@
|
||||
namespace Dot.Time;
|
||||
|
||||
[Verb("time", HelpText = nameof(Str.TimeTool), ResourceType = typeof(Str))]
|
||||
public class Option : OptionBase
|
||||
{
|
||||
[Option('s', "sync", HelpText = nameof(Str.SyncToLocalTime), Default = false, ResourceType = typeof(Str))]
|
||||
[CommandOption("-s|--sync")]
|
||||
[Description(nameof(Str.SyncToLocalTime))]
|
||||
[Localization(typeof(Str))]
|
||||
[DefaultValue(false)]
|
||||
public bool Sync { get; set; }
|
||||
|
||||
[Option('t', "timeout", HelpText = nameof(Str.TimeoutMillSecs), Default = 2000, ResourceType = typeof(Str))]
|
||||
|
||||
[CommandOption("-t|--timeout")]
|
||||
[Description(nameof(Str.TimeoutMillSecs))]
|
||||
[Localization(typeof(Str))]
|
||||
[DefaultValue(2000)]
|
||||
public int Timeout { get; set; }
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
using System.ComponentModel;
|
||||
using NSExt.Extensions;
|
||||
using Spectre.Console.Rendering;
|
||||
|
||||
|
Reference in New Issue
Block a user