From ceb7bf8b3960eae86ae5126b64b83bc5ed1294a3 Mon Sep 17 00:00:00 2001 From: Cj <161484149+CJ-SPT@users.noreply.github.com> Date: Sat, 11 Jan 2025 14:05:41 -0500 Subject: [PATCH] add getruntimeversion command --- ReCodeItCLI/Commands/GetRuntimeVersion.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 ReCodeItCLI/Commands/GetRuntimeVersion.cs diff --git a/ReCodeItCLI/Commands/GetRuntimeVersion.cs b/ReCodeItCLI/Commands/GetRuntimeVersion.cs new file mode 100644 index 0000000..41577fc --- /dev/null +++ b/ReCodeItCLI/Commands/GetRuntimeVersion.cs @@ -0,0 +1,22 @@ +using CliFx; +using CliFx.Attributes; +using CliFx.Infrastructure; +using ReCodeItLib.Utils; + +namespace ReCodeItCLI.Commands; + +[Command("GetRuntimeVersion", Description = "Prints out the .net runtime version this assembly targets")] +public class GetRuntimeVersion : ICommand +{ + [CommandParameter(0, IsRequired = true, Description = "The absolute path to your dll.")] + public required string AssemblyPath { get; init; } + + public ValueTask ExecuteAsync(IConsole console) + { + var module = DataProvider.LoadModule(AssemblyPath); + + Logger.LogSync($"Target Runtime Version: {module.RuntimeVersion}"); + + return default; + } +} \ No newline at end of file