Initial commit
This commit is contained in:
21
CommandRegistry.cs
Normal file
21
CommandRegistry.cs
Normal file
@ -0,0 +1,21 @@
|
||||
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));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user