Edit

Share via


CommandLineBuilderExtensions Class

Definition

Provides extension methods for CommandLineBuilder.

public ref class CommandLineBuilderExtensions abstract sealed
public static class CommandLineBuilderExtensions
type CommandLineBuilderExtensions = class
Public Module CommandLineBuilderExtensions
Inheritance
CommandLineBuilderExtensions

Methods

AddMiddleware(CommandLineBuilder, Action<InvocationContext>, MiddlewareOrder)

Adds a middleware delegate to the invocation pipeline called before a command handler is invoked.

AddMiddleware(CommandLineBuilder, InvocationMiddleware, MiddlewareOrder)

Adds a middleware delegate to the invocation pipeline called before a command handler is invoked.

CancelOnProcessTermination(CommandLineBuilder)

Enables signaling and handling of process termination via a CancellationToken that can be passed to a ICommandHandler during invocation.

EnableDirectives(CommandLineBuilder, Boolean)

Enables the parser to recognize command line directives.

EnableLegacyDoubleDashBehavior(CommandLineBuilder, Boolean)

Determines the behavior when parsing a double dash (--) in a command line.

EnablePosixBundling(CommandLineBuilder, Boolean)

Enables the parser to recognize and expand POSIX-style bundled options.

ParseResponseFileAs(CommandLineBuilder, ResponseFileHandling)

Configures the parser's handling of response files. When enabled, a command line token beginning with @ that is a valid file path will be expanded as though inserted into the command line.

RegisterWithDotnetSuggest(CommandLineBuilder)

Ensures that the application is registered with the dotnet-suggest tool to enable command line completions.

UseDefaults(CommandLineBuilder)

Uses the default configuration.

UseEnvironmentVariableDirective(CommandLineBuilder)

Enables the use of the [env:key=value] directive, allowing environment variables to be set from the command line during invocation.

UseExceptionHandler(CommandLineBuilder, Action<Exception,InvocationContext>, Nullable<Int32>)

Enables an exception handler to catch any unhandled exceptions thrown by a command handler during invocation.

UseHelp(CommandLineBuilder, Action<HelpContext>, Nullable<Int32>)

Configures the application to show help when one of the specified option aliases are used on the command line.

UseHelp(CommandLineBuilder, Nullable<Int32>)

Configures the application to show help when one of the following options are specified on the command line:

-h
/h
--help
-?
/?
UseHelp(CommandLineBuilder, String[])

Configures the application to show help when one of the specified option aliases are used on the command line.

UseHelpBuilder<TBuilder>(TBuilder, Func<BindingContext,HelpBuilder>)

Specifies an HelpBuilder to be used to format help output when help is requested.

UseLocalizationResources(CommandLineBuilder, LocalizationResources)

Specifies localization resources to be used when displaying help, error messages, and other user-facing strings.

UseParseDirective(CommandLineBuilder, Nullable<Int32>)

Enables the use of the [parse] directive, which when specified on the command line will short circuit normal command handling and display a diagram explaining the parse result for the command line input.

UseParseErrorReporting(CommandLineBuilder, Nullable<Int32>)

Configures the command line to write error information to standard error when there are errors parsing command line input.

UseSuggestDirective(CommandLineBuilder)

Enables the use of the [suggest] directive which when specified in command line input short circuits normal command handling and writes a newline-delimited list of suggestions suitable for use by most shells to provide command line completions.

UseTypoCorrections(CommandLineBuilder, Int32)

Configures the application to provide alternative suggestions when a parse error is detected.

UseVersionOption(CommandLineBuilder, String[])

Enables the use of a option (defaulting to the alias --version) which when specified in command line input will short circuit normal command handling and instead write out version information before exiting.

UseVersionOption(CommandLineBuilder)

Enables the use of a option (defaulting to the alias --version) which when specified in command line input will short circuit normal command handling and instead write out version information before exiting.

Applies to