From 07e7fb1801e2fab0f24085ff6d8acd373c5db609 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Mon, 9 Dec 2024 16:03:27 +0000 Subject: [PATCH] Change CLI library --- .../KeepersCompound.Lightmapper.csproj | 2 +- KeepersCompound.Lightmapper/Program.cs | 38 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/KeepersCompound.Lightmapper/KeepersCompound.Lightmapper.csproj b/KeepersCompound.Lightmapper/KeepersCompound.Lightmapper.csproj index bd3937a..b6e0b2c 100644 --- a/KeepersCompound.Lightmapper/KeepersCompound.Lightmapper.csproj +++ b/KeepersCompound.Lightmapper/KeepersCompound.Lightmapper.csproj @@ -8,7 +8,7 @@ - + diff --git a/KeepersCompound.Lightmapper/Program.cs b/KeepersCompound.Lightmapper/Program.cs index 13d7577..48b52b8 100644 --- a/KeepersCompound.Lightmapper/Program.cs +++ b/KeepersCompound.Lightmapper/Program.cs @@ -1,36 +1,36 @@ -using CliFx; -using CliFx.Attributes; -using IConsole = CliFx.Infrastructure.IConsole; +using DotMake.CommandLine; namespace KeepersCompound.Lightmapper; internal static class Program { - public static async Task Main() => - await new CliApplicationBuilder().AddCommandsFromThisAssembly().Build().RunAsync(); + public static async Task Main(string[] args) => + await Cli.RunAsync(args); } -[Command(Description = "Compute lightmaps for a NewDark .MIS/.COW")] -public class LightCommand : ICommand +[CliCommand(Description = "Compute lightmaps for a NewDark .MIS/.COW")] +public class LightCommand { - [CommandParameter(0, Description = "The path to the root Thief installation.")] - public required string InstallPath { get; init; } - [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"; + [CliArgument(Description = "The path to the root Thief installation.")] + public required string InstallPath { get; set; } + + [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 ValueTask ExecuteAsync(IConsole console) + public void Run() { Timing.Reset(); - + var lightMapper = new LightMapper(InstallPath, CampaignName, MissionName); lightMapper.Light(); lightMapper.Save(OutputName); - + Timing.LogAll(); - return default; } } \ No newline at end of file