IConfigurator Interface
Represents a configurator.
public interface IConfigurator
- Namespace
- Spectre
.Console .Cli
Properties
- abstract ICommandAppSettings Settings
- Gets the command app settings.
Methods
-
abstract ICommandConfigurator AddAsyncDelegate
<TSettings> (string, Func <CommandContext, TSettings, Task <int> > ) - Adds a command that executes an async delegate.
-
abstract IBranchConfigurator AddBranch
<TSettings> (string, Action <IConfigurator <TSettings> > ) - Adds a command branch.
-
abstract ICommandConfigurator AddCommand
<TCommand> (string) - Adds a command.
-
abstract ICommandConfigurator AddDelegate
<TSettings> (string, Func <CommandContext, TSettings, int> ) - Adds a command that executes a delegate.
-
abstract void AddExample
(string[]) - Adds an example of how to use the application.
-
abstract void SetHelpProvider
(IHelpProvider) - Sets the help provider for the application.
-
abstract void SetHelpProvider
<T> () - Sets the help provider for the application.
Extension Methods
-
ICommandConfigurator AddAsyncDelegate
(string, Func <CommandContext, Task <int> > ) - Adds a command without settings that executes an async delegate.
-
IBranchConfigurator AddBranch
(string, Action <IConfigurator < Command Settings> > ) - Adds a command branch.
-
ICommandConfigurator AddDelegate
(string, Func <CommandContext, int> ) - Adds a command without settings that executes a delegate.
-
IConfigurator CaseSensitivity
(CaseSensitivity) - Configures case sensitivity.
-
IConfigurator ConfigureConsole
(IAnsiConsole) - Configures the console.
-
IConfigurator Hide
Option Default Values () -
Hides the
DEFAULT
column that lists default values coming from theSystem.ComponentModel.DefaultValueAttribute
in the options help text. -
IConfigurator PropagateExceptions
() - Tells the command line application to propagate all exceptions to the user.
-
IUnsafeConfigurator SafetyOff
() -
Gets an
IUnsafeConfigurator
that allows composition of commands without type safety. -
IConfigurator Set
Application Culture (CultureInfo) - Sets the culture for the application.
-
IConfigurator SetApplicationName
(string) - Sets the name of the application.
-
IConfigurator Set
Application Version (string) - Sets the version of the application.
-
IConfigurator SetExceptionHandler
(Action <Exception, ITypeResolver> ) -
Sets the ExceptionsHandler.
Setting
ExceptionHandler
this way will use the default exit code of -1. -
IConfigurator SetExceptionHandler
(Func <Exception, ITypeResolver, int> ) - Sets the ExceptionsHandler.
-
IConfigurator SetHelpProvider
(IHelpProvider) - Sets the help provider for the application.
-
IConfigurator SetHelpProvider
<T> () - Sets the help provider for the application.
-
IConfigurator SetInterceptor
( I Command Interceptor) - Sets the command interceptor to be used.
-
IConfigurator TrimTrailingPeriods
(bool) - Tells the help writer whether or not to trim trailing period.
-
IConfigurator Use
Assembly Informational Version () -
Uses the version retrieved from the
System.Reflection.AssemblyInformationalVersionAttribute
as the application's version. -
IConfigurator UseStrictParsing
() - Sets the parsing mode to strict.
-
IConfigurator ValidateExamples
() - Tells the command line application to validate all examples before running the application.