22 lines
517 B
C#
22 lines
517 B
C#
namespace Automancer.Common;
|
|
|
|
public record CommandInfo(string Path, string? Description);
|
|
|
|
public class CommandRegistry
|
|
{
|
|
public List<CommandInfo> Commands { get; } = new();
|
|
|
|
public void AddModule(ICommandModule module)
|
|
{
|
|
if (!string.IsNullOrWhiteSpace(module.Name))
|
|
{
|
|
Commands.Add(new CommandInfo(module.Name, module.Description));
|
|
}
|
|
}
|
|
|
|
public void Add(string path, string? description)
|
|
{
|
|
Commands.Add(new CommandInfo(path, description));
|
|
}
|
|
}
|