mycroforge/MycroForge.CLI/Commands/MycroForge.Plugin.List.cs

26 lines
671 B
C#

using System.CommandLine;
using MycroForge.Core.Contract;
namespace MycroForge.CLI.Commands;
public partial class MycroForge
{
public partial class Plugin
{
public class List : Command, ISubCommandOf<Plugin>
{
public List() : base("list", "List all installed plugins")
{
AddAlias("l");
AddAlias("ls");
this.SetHandler(ExecuteAsync);
}
private void ExecuteAsync()
{
foreach (var plugin in Plugins.Loaded)
Console.WriteLine($"{plugin.Name}");
}
}
}
}