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

View File

@@ -0,0 +1,18 @@
namespace AnchorCli.Commands;
public class CommandRegistry
{
private readonly Dictionary<string, ICommand> _commands = new(StringComparer.OrdinalIgnoreCase);
public void Register(ICommand command)
{
_commands[command.Name] = command;
}
public ICommand? GetCommand(string name)
{
return _commands.TryGetValue(name, out var cmd) ? cmd : null;
}
public IEnumerable<ICommand> GetAllCommands() => _commands.Values;
}