[feat] Abyssctl Automatic module discovery
This commit is contained in:
		| @@ -1,18 +1,20 @@ | ||||
| using abyssctl.App.Interfaces; | ||||
| using abyssctl.Model; | ||||
| using CommandLine; | ||||
|  | ||||
| namespace abyssctl.App.Modules; | ||||
|  | ||||
| [Verb("hello", HelpText = "Say hello to abyss server")] | ||||
| public class HelloOptions | ||||
| public class HelloOptions: IOptions | ||||
| { | ||||
|     public static int Run(HelloOptions opts) | ||||
|     public async Task<int> Run() | ||||
|     { | ||||
|         var r = App.CtlWriteRead(new Ctl | ||||
|         var r = await App.CtlWriteRead(new Ctl | ||||
|         { | ||||
|             Head = 100, | ||||
|             Params = [] | ||||
|         }).GetAwaiter().GetResult(); | ||||
|         }); | ||||
|          | ||||
|         Console.WriteLine($"Response Code: {r.Head}"); | ||||
|         Console.WriteLine($"Params: {string.Join(",", r.Params)}"); | ||||
|         return 0; | ||||
|   | ||||
| @@ -1,11 +1,12 @@ | ||||
| using abyssctl.App.Interfaces; | ||||
| using CommandLine; | ||||
|  | ||||
| namespace abyssctl.App.Modules; | ||||
|  | ||||
| [Verb("ver", HelpText = "Get server version")] | ||||
| public class VersionOptions | ||||
| public class VersionOptions: IOptions | ||||
| { | ||||
|     public static int Run(VersionOptions opts) | ||||
|     public async Task<int> Run() | ||||
|     { | ||||
|         Console.WriteLine("Version"); | ||||
|         return 0; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 acite
					acite