Represents a configurator.
Properties
Settings
: ICommandAppSettingsGets the command app settings.
Methods
public ICommandConfigurator AddAsyncDelegate<TSettings>(string name, Func<CommandContext, TSettings, CancellationToken, Task<int>> func)
Adds a command that executes an async delegate.
Parameters:
name (string)func (Func<CommandContext, TSettings, CancellationToken, Task<int>>)Returns:
A command configurator that can be used to configure the command further.
public IBranchConfigurator AddBranch<TSettings>(string name, Action<IConfigurator<TSettings>> action)
Adds a command branch.
Parameters:
name (string)action (Action<IConfigurator<TSettings>>)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<TSettings>(string name, Func<CommandContext, TSettings, CancellationToken, int> func)
Adds a command that executes a delegate.
Parameters:
name (string)func (Func<CommandContext, TSettings, CancellationToken, int>)Returns:
A command configurator that can be used to configure the command further.
public IConfigurator AddExample(string[] args)
Adds an example of how to use the application.
Parameters:
args (string[])Returns:
A configurator that can be used for further configuration.
public IConfigurator SetHelpProvider(IHelpProvider helpProvider)
Sets the help provider for the application.
Parameters:
helpProvider (IHelpProvider)Returns:
A configurator that can be used for further configuration.
public IConfigurator SetHelpProvider<T>()
Sets the help provider for the application.
Returns:
A configurator that can be used for further configuration.
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.