Change CLI library
This commit is contained in:
		
							parent
							
								
									1b962831a0
								
							
						
					
					
						commit
						07e7fb1801
					
				|  | @ -8,7 +8,7 @@ | ||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
| 
 | 
 | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|     <PackageReference Include="clifx" Version="2.3.5" /> |     <PackageReference Include="DotMake.CommandLine" Version="1.8.8" /> | ||||||
|     <PackageReference Include="TinyEmbree" Version="1.0.3" /> |     <PackageReference Include="TinyEmbree" Version="1.0.3" /> | ||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,28 +1,29 @@ | ||||||
| using CliFx; | using DotMake.CommandLine; | ||||||
| using CliFx.Attributes; |  | ||||||
| using IConsole = CliFx.Infrastructure.IConsole; |  | ||||||
| 
 | 
 | ||||||
| namespace KeepersCompound.Lightmapper; | namespace KeepersCompound.Lightmapper; | ||||||
| 
 | 
 | ||||||
| internal static class Program | internal static class Program | ||||||
| { | { | ||||||
|     public static async Task<int> Main() => |     public static async Task<int> Main(string[] args) => | ||||||
|         await new CliApplicationBuilder().AddCommandsFromThisAssembly().Build().RunAsync(); |         await Cli.RunAsync<LightCommand>(args); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| [Command(Description = "Compute lightmaps for a NewDark .MIS/.COW")] | [CliCommand(Description = "Compute lightmaps for a NewDark .MIS/.COW")] | ||||||
| public class LightCommand : ICommand | public class LightCommand | ||||||
| { | { | ||||||
|     [CommandParameter(0, Description = "The path to the root Thief installation.")] |     [CliArgument(Description = "The path to the root Thief installation.")] | ||||||
|     public required string InstallPath { get; init; } |     public required string InstallPath { get; set; } | ||||||
|     [CommandParameter(1, Description = "The folder name of the fan mission. For OMs this is blank.")] |  | ||||||
|     public required string CampaignName { get; init; } |  | ||||||
|     [CommandParameter(2, Description = "The name of the mission file including extension.")] |  | ||||||
|     public required string MissionName { get; init; } |  | ||||||
|     [CommandOption("output", 'o', Description = "Name of output file excluding extension.")] |  | ||||||
|     public string OutputName { get; init; } = "kc_lit"; |  | ||||||
|      |      | ||||||
|     public ValueTask ExecuteAsync(IConsole console) |     [CliArgument(Description = "The folder name of the fan mission. For OMs this is blank.")] | ||||||
|  |     public required string CampaignName { get; set; } | ||||||
|  |      | ||||||
|  |     [CliArgument(Description = "The name of the mission file including extension.")] | ||||||
|  |     public required string MissionName { get; set; } | ||||||
|  |      | ||||||
|  |     [CliOption(Description = "Name of output file excluding extension.")] | ||||||
|  |     public string OutputName { get; set; } = "kc_lit"; | ||||||
|  | 
 | ||||||
|  |     public void Run() | ||||||
|     { |     { | ||||||
|         Timing.Reset(); |         Timing.Reset(); | ||||||
|               |               | ||||||
|  | @ -31,6 +32,5 @@ public class LightCommand : ICommand | ||||||
|         lightMapper.Save(OutputName); |         lightMapper.Save(OutputName); | ||||||
|           |           | ||||||
|         Timing.LogAll(); |         Timing.LogAll(); | ||||||
|         return default; |  | ||||||
|     } |     } | ||||||
| } | } | ||||||
		Loading…
	
		Reference in New Issue