Browse Source

Last command settings refactored

James 1 tháng trước cách đây
mục cha
commit
8bf5230691

+ 20 - 0
Shared.Rcl/Commands/Laptops/Cpus/LaptopCpuAddCommand.cs

@@ -1,3 +1,4 @@
+using System.ComponentModel;
 using Microsoft.Extensions.DependencyInjection;
 using RackPeek.Domain.Resources.Laptops;
 using RackPeek.Domain.UseCases.Cpus;
@@ -6,6 +7,25 @@ using Spectre.Console.Cli;
 
 namespace Shared.Rcl.Commands.Laptops.Cpus;
 
+public class LaptopCpuAddSettings : CommandSettings
+{
+    [CommandArgument(0, "<Laptop>")]
+    [Description("The Laptop name.")]
+    public string LaptopName { get; set; } = default!;
+
+    [CommandOption("--model")]
+    [Description("The model name.")]
+    public string? Model { get; set; }
+
+    [CommandOption("--cores")]
+    [Description("The number of cpu cores.")]
+    public int? Cores { get; set; }
+
+    [CommandOption("--threads")]
+    [Description("The number of cpu threads.")]
+    public int? Threads { get; set; }
+}
+
 public class LaptopCpuAddCommand(IServiceProvider provider)
     : AsyncCommand<LaptopCpuAddSettings>
 {

+ 0 - 23
Shared.Rcl/Commands/Laptops/Cpus/LaptopCpuAddSettings.cs

@@ -1,23 +0,0 @@
-using System.ComponentModel;
-using Spectre.Console.Cli;
-
-namespace Shared.Rcl.Commands.Laptops.Cpus;
-
-public class LaptopCpuAddSettings : CommandSettings
-{
-    [CommandArgument(0, "<Laptop>")]
-    [Description("The Laptop name.")]
-    public string LaptopName { get; set; } = default!;
-
-    [CommandOption("--model")]
-    [Description("The model name.")]
-    public string? Model { get; set; }
-
-    [CommandOption("--cores")]
-    [Description("The number of cpu cores.")]
-    public int? Cores { get; set; }
-
-    [CommandOption("--threads")]
-    [Description("The number of cpu threads.")]
-    public int? Threads { get; set; }
-}

+ 12 - 0
Shared.Rcl/Commands/Laptops/Cpus/LaptopCpuRemoveCommand.cs

@@ -1,3 +1,4 @@
+using System.ComponentModel;
 using Microsoft.Extensions.DependencyInjection;
 using RackPeek.Domain.Resources.Laptops;
 using RackPeek.Domain.UseCases.Cpus;
@@ -6,6 +7,17 @@ using Spectre.Console.Cli;
 
 namespace Shared.Rcl.Commands.Laptops.Cpus;
 
+public class LaptopCpuRemoveSettings : CommandSettings
+{
+    [CommandArgument(0, "<Laptop>")]
+    [Description("The name of the Laptop.")]
+    public string LaptopName { get; set; } = default!;
+
+    [CommandArgument(1, "<index>")]
+    [Description("The index of the Laptop cpu to remove.")]
+    public int Index { get; set; }
+}
+
 public class LaptopCpuRemoveCommand(IServiceProvider provider)
     : AsyncCommand<LaptopCpuRemoveSettings>
 {

+ 0 - 15
Shared.Rcl/Commands/Laptops/Cpus/LaptopCpuRemoveSettings.cs

@@ -1,15 +0,0 @@
-using System.ComponentModel;
-using Spectre.Console.Cli;
-
-namespace Shared.Rcl.Commands.Laptops.Cpus;
-
-public class LaptopCpuRemoveSettings : CommandSettings
-{
-    [CommandArgument(0, "<Laptop>")]
-    [Description("The name of the Laptop.")]
-    public string LaptopName { get; set; } = default!;
-
-    [CommandArgument(1, "<index>")]
-    [Description("The index of the Laptop cpu to remove.")]
-    public int Index { get; set; }
-}

+ 24 - 0
Shared.Rcl/Commands/Laptops/Cpus/LaptopCpuSetCommand.cs

@@ -1,3 +1,4 @@
+using System.ComponentModel;
 using Microsoft.Extensions.DependencyInjection;
 using RackPeek.Domain.Resources.Laptops;
 using RackPeek.Domain.UseCases.Cpus;
@@ -6,6 +7,29 @@ using Spectre.Console.Cli;
 
 namespace Shared.Rcl.Commands.Laptops.Cpus;
 
+public class LaptopCpuSetSettings : CommandSettings
+{
+    [CommandArgument(0, "<Laptop>")]
+    [Description("The Laptop name.")]
+    public string LaptopName { get; set; } = default!;
+
+    [CommandArgument(1, "<index>")]
+    [Description("The index of the Laptop cpu.")]
+    public int Index { get; set; }
+
+    [CommandOption("--model")]
+    [Description("The cpu model.")]
+    public string? Model { get; set; }
+
+    [CommandOption("--cores")]
+    [Description("The number of cpu cores.")]
+    public int? Cores { get; set; }
+
+    [CommandOption("--threads")]
+    [Description("The number of cpu threads.")]
+    public int? Threads { get; set; }
+}
+
 public class LaptopCpuSetCommand(IServiceProvider provider)
     : AsyncCommand<LaptopCpuSetSettings>
 {

+ 0 - 27
Shared.Rcl/Commands/Laptops/Cpus/LaptopCpuSetSettings.cs

@@ -1,27 +0,0 @@
-using System.ComponentModel;
-using Spectre.Console.Cli;
-
-namespace Shared.Rcl.Commands.Laptops.Cpus;
-
-public class LaptopCpuSetSettings : CommandSettings
-{
-    [CommandArgument(0, "<Laptop>")]
-    [Description("The Laptop name.")]
-    public string LaptopName { get; set; } = default!;
-
-    [CommandArgument(1, "<index>")]
-    [Description("The index of the Laptop cpu.")]
-    public int Index { get; set; }
-
-    [CommandOption("--model")]
-    [Description("The cpu model.")]
-    public string? Model { get; set; }
-
-    [CommandOption("--cores")]
-    [Description("The number of cpu cores.")]
-    public int? Cores { get; set; }
-
-    [CommandOption("--threads")]
-    [Description("The number of cpu threads.")]
-    public int? Threads { get; set; }
-}