IConfigurator<TSettings> Interface
Represents a configurator for specific settings.
public interface IConfigurator<in TSettings> where TSettings : CommandSettings
- Namespace
- Spectre
.Console .Cli
Parameters
-
TSettings
- The command setting type.
Methods
-
abstract ICommandConfigurator AddAsyncDelegate
< T Derived Settings> (string, Func <CommandContext, TDerivedSettings, Task <int> > ) - Adds a command that executes an async delegate.
-
abstract IBranchConfigurator AddBranch
< T Derived Settings> (string, Action <IConfigurator < T Derived Settings> > ) - Adds a command branch.
-
abstract ICommandConfigurator AddCommand
<TCommand> (string) - Adds a command.
-
abstract ICommandConfigurator AddDelegate
< T Derived Settings> (string, Func <CommandContext, TDerivedSettings, int> ) - Adds a command that executes a delegate.
-
abstract void AddExample
(string[]) - Adds an example of how to use the branch.
-
abstract void HideBranch
() - Marks the branch as hidden. Hidden branches do not show up in help documentation or generated XML models.
-
abstract void SetDefaultCommand
< T Default Command> () - Adds a default command.
-
abstract void SetDescription
(string) - Sets the description of the branch.
Extension Methods
-
ICommandConfigurator AddAsyncDelegate
<TSettings> (string, Func <CommandContext, Task <int> > ) - Adds a command without settings that executes an async delegate.
-
IBranchConfigurator AddBranch
<TSettings> (string, Action <IConfigurator <TSettings> > ) - Adds a command branch.
-
ICommandConfigurator AddDelegate
<TSettings> (string, Func <CommandContext, int> ) - Adds a command without settings that executes a delegate.
-
IUnsafeConfigurator SafetyOff
<TSettings> () -
Gets an
IUnsafeConfigurator
that allows composition of commands without type safety.