1
0

initial commit

This commit is contained in:
2026-03-04 07:59:35 +01:00
commit 3ceb0e4884
27 changed files with 2280 additions and 0 deletions

33
Commands/HelpCommand.cs Normal file
View File

@@ -0,0 +1,33 @@
using Spectre.Console;
using System.Linq;
namespace AnchorCli.Commands;
public class HelpCommand : ICommand
{
private readonly CommandRegistry _registry;
public string Name => "help";
public string Description => "Show available commands";
public HelpCommand(CommandRegistry registry)
{
_registry = registry;
}
public Task ExecuteAsync(string[] args, CancellationToken ct)
{
AnsiConsole.MarkupLine("[cyan]Available commands:[/]");
var table = new Table();
table.AddColumn("Command");
table.AddColumn("Description");
foreach (var cmd in _registry.GetAllCommands().OrderBy(c => c.Name))
{
table.AddRow($"[bold]{cmd.Name}[/]", cmd.Description);
}
AnsiConsole.Write(table);
return Task.CompletedTask;
}
}