feat: plugins
This commit is contained in:
		@@ -4,21 +4,16 @@ using Spectre.Console.Cli;
 | 
			
		||||
 | 
			
		||||
namespace Automancer.Command.Container;
 | 
			
		||||
 | 
			
		||||
public class Module : ICommandModuleWithRegistry
 | 
			
		||||
public class Module : ICommandModule
 | 
			
		||||
{
 | 
			
		||||
    public void Configure(IConfigurator config)
 | 
			
		||||
    {
 | 
			
		||||
        // No implementation needed here
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public string Name => "container";
 | 
			
		||||
    public string Description => "Container operations";
 | 
			
		||||
    public void Configure(IConfigurator config, CommandRegistry registry)
 | 
			
		||||
    {
 | 
			
		||||
        config.AddBranch("container", container =>
 | 
			
		||||
        config.AddBranch(Name, container =>
 | 
			
		||||
        {
 | 
			
		||||
            var description = "Container operations";
 | 
			
		||||
            
 | 
			
		||||
            container.SetDescription(description);
 | 
			
		||||
            registry.Add("container", description);
 | 
			
		||||
            container.SetDescription(Description);
 | 
			
		||||
            registry.Add(Name, Description);
 | 
			
		||||
 | 
			
		||||
            container.AddCommand<PsCommand>("ps").WithDescription("List containers");
 | 
			
		||||
        });
 | 
			
		||||
 
 | 
			
		||||
@@ -3,18 +3,15 @@ using Spectre.Console.Cli;
 | 
			
		||||
 | 
			
		||||
namespace Automancer.Command.Image;
 | 
			
		||||
 | 
			
		||||
public class Module : ICommandModuleWithRegistry
 | 
			
		||||
public class Module : ICommandModule
 | 
			
		||||
{
 | 
			
		||||
    public void Configure(IConfigurator config)
 | 
			
		||||
    {
 | 
			
		||||
        // No implementation needed here
 | 
			
		||||
    }
 | 
			
		||||
   public string Name => "image";
 | 
			
		||||
   public string Description => "Docker/podman image operations";
 | 
			
		||||
    public void Configure(IConfigurator config, CommandRegistry registry)
 | 
			
		||||
    {
 | 
			
		||||
        config.AddBranch("image", image => {
 | 
			
		||||
            var description = "Docker/podman image operations";
 | 
			
		||||
            image.SetDescription(description);
 | 
			
		||||
            registry.Add("image", description);
 | 
			
		||||
        config.AddBranch(Name, image => {
 | 
			
		||||
            image.SetDescription(Description);
 | 
			
		||||
            registry.Add(Name, Description);
 | 
			
		||||
 | 
			
		||||
            image.AddCommand<BuildCommand>("build").WithDescription("Build a docker image");
 | 
			
		||||
            image.AddCommand<PushCommand>("push").WithDescription("Push a docker image");
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user