feat: Dynamic command loader, default command with module registry

This commit is contained in:
2025-04-20 12:38:27 +02:00
parent a7cae86254
commit cea3d11a41
13 changed files with 373 additions and 3 deletions

View File

@ -0,0 +1,34 @@
using System.ComponentModel;
using Spectre.Console.Cli;
namespace Automancer.Command.Image;
public class BuldSettings: CommandSettings
{
[CommandArgument(0, "[path]")]
[Description("Path to the Dockerfile")]
public string? Path { get; set; }
[CommandOption("-t|--tag")]
[Description("Tag to use for the image")]
public string? Tag { get; set; }
[CommandOption("-f|--file")]
[Description("Path to the Dockerfile")]
public string? File { get; set; }
[CommandOption("--push")]
[Description("Push the image after building it")]
public bool Push { get; set; }
}
public class BuildCommand : Command<BuldSettings>
{
public override int Execute(CommandContext context, BuldSettings settings)
{
Console.WriteLine($"Building image from {settings.Path} with tag {settings.Tag}");
return 0;
}
}