mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-20 05:48:14 +08:00
Add Spectre.Cli to Spectre.Console
* Renames Spectre.Cli to Spectre.Console.Cli. * Now uses Verify with Spectre.Console.Cli tests. * Removes some duplicate definitions. Closes #168
This commit is contained in:

committed by
Patrik Svensson

parent
0bbf9b81a9
commit
0ae419326d
@ -0,0 +1,42 @@
|
||||
namespace Spectre.Console.Cli.Internal
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user