Represents a configurator for specific settings.
Methods
public ICommandConfigurator AddAsyncDelegate<TDerivedSettings>(string name, Func<CommandContext, TDerivedSettings, CancellationToken, Task<int>> func)
Adds a command that executes an async delegate.
Parameters:
name (string)func (Func<CommandContext, TDerivedSettings, CancellationToken, Task<int>>)Returns:
A command configurator that can be used to configure the command further.
public IBranchConfigurator AddBranch<TDerivedSettings>(string name, Action<IConfigurator<TDerivedSettings>> action)
Adds a command branch.
Parameters:
name (string)action (Action<IConfigurator<TDerivedSettings>>)Returns:
A branch configurator that can be used to configure the branch further.
public ICommandConfigurator AddCommand<TCommand>(string name)
Adds a command.
Parameters:
name (string)Returns:
A command configurator that can be used to configure the command further.
public ICommandConfigurator AddDelegate<TDerivedSettings>(string name, Func<CommandContext, TDerivedSettings, CancellationToken, int> func)
Adds a command that executes a delegate.
Parameters:
name (string)func (Func<CommandContext, TDerivedSettings, CancellationToken, int>)Returns:
A command configurator that can be used to configure the command further.
public void AddExample(string[] args)
Adds an example of how to use the branch.
Parameters:
args (string[])public void HideBranch()
Marks the branch as hidden. Hidden branches do not show up in help documentation or generated XML models.
public void SetDefaultCommand<TDefaultCommand>()
Adds a default command.
public void SetDescription(string description)
Sets the description of the branch.
Parameters:
description (string)Extension Methods
IConfigurator HideOptionDefaultValues(this IConfigurator configurator)Hides the DEFAULT column that lists default values coming from the DefaultValueAttribute in the options help text.
Returns:
A configurator that can be used to configure the application further.
IUnsafeConfigurator SafetyOff(this IConfigurator configurator)Gets an IUnsafeConfigurator that allows composition of commands without type safety.
Returns:
An IUnsafeConfigurator.
IUnsafeConfigurator SafetyOff<TSettings>(this IConfigurator<TSettings> configurator)Gets an IUnsafeConfigurator that allows composition of commands without type safety.
Returns:
An IUnsafeConfigurator.
IConfigurator SetApplicationCulture(this IConfigurator configurator, CultureInfo culture)Sets the culture for the application.
Returns:
A configurator that can be used to configure the application further.
IConfigurator SetApplicationName(this IConfigurator configurator, string name)Sets the name of the application.
Returns:
A configurator that can be used to configure the application further.
IConfigurator SetApplicationVersion(this IConfigurator configurator, string version)Sets the version of the application.
Returns:
A configurator that can be used to configure the application further.
IConfigurator SetHelpProvider(this IConfigurator configurator, IHelpProvider helpProvider)Sets the help provider for the application.
Returns:
A configurator that can be used to configure the application further.
IConfigurator SetHelpProvider<T>(this IConfigurator configurator)Sets the help provider for the application.
Returns:
A configurator that can be used to configure the application further.
IConfigurator UseAssemblyInformationalVersion(this IConfigurator configurator)Uses the version retrieved from the AssemblyInformationalVersionAttribute as the application's version.
Returns:
A configurator that can be used to configure the application further.