mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 13:28:16 +08:00
41 lines
871 B
C#
41 lines
871 B
C#
namespace Spectre.Console.Cli;
|
|
|
|
internal sealed class CommandConfigurator : ICommandConfigurator
|
|
{
|
|
public ConfiguredCommand Command { get; }
|
|
|
|
public CommandConfigurator(ConfiguredCommand command)
|
|
{
|
|
Command = command;
|
|
}
|
|
|
|
public ICommandConfigurator WithExample(string[] args)
|
|
{
|
|
Command.Examples.Add(args);
|
|
return this;
|
|
}
|
|
|
|
public ICommandConfigurator WithAlias(string alias)
|
|
{
|
|
Command.Aliases.Add(alias);
|
|
return this;
|
|
}
|
|
|
|
public ICommandConfigurator WithDescription(string description)
|
|
{
|
|
Command.Description = description;
|
|
return this;
|
|
}
|
|
|
|
public ICommandConfigurator WithData(object data)
|
|
{
|
|
Command.Data = data;
|
|
return this;
|
|
}
|
|
|
|
public ICommandConfigurator IsHidden()
|
|
{
|
|
Command.IsHidden = true;
|
|
return this;
|
|
}
|
|
} |