C# Класс System.CommandLine.CommandLineConfiguration

Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
DefaultHelpBuilderFactory System.CommandLine.HelpBuilder
DefaultHelpBuilderFactory System.Collections.Generic
DefaultTokenReplacer bool
GetChild System.CommandLine.IdentifierSymbol
ThrowIfInvalid void

Открытые методы

Метод Описание
CommandLineConfiguration ( System.CommandLine.Command command, bool enablePosixBundling = true, bool enableDirectives = true, bool enableTokenReplacement = true, LocalizationResources? resources = null, IReadOnlyList? middlewarePipeline = null, HelpBuilder>?.Func helpBuilderFactory = null, TryReplaceToken? tokenReplacer = null ) : System.Collections.Generic

Initializes a new instance of the CommandLineConfiguration class.

ThrowIfInvalid ( ) : void

Throws an exception if the parser configuration is ambiguous or otherwise not valid.

Due to the performance cost of this method, it is recommended to be used in unit testing or in scenarios where the parser is configured dynamically at runtime.

Приватные методы

Метод Описание
DefaultHelpBuilderFactory ( BindingContext context, int? requestedMaxWidth = null ) : System.CommandLine.HelpBuilder
DefaultHelpBuilderFactory ( ) : System.Collections.Generic
DefaultTokenReplacer ( string tokenToReplace, IReadOnlyList? &replacementTokens, string? &errorMessage ) : bool
GetChild ( int index, System.CommandLine.Command command ) : System.CommandLine.IdentifierSymbol
ThrowIfInvalid ( System.CommandLine.Command command ) : void

Описание методов

CommandLineConfiguration() публичный Метод

Initializes a new instance of the CommandLineConfiguration class.
public CommandLineConfiguration ( System.CommandLine.Command command, bool enablePosixBundling = true, bool enableDirectives = true, bool enableTokenReplacement = true, LocalizationResources? resources = null, IReadOnlyList? middlewarePipeline = null, HelpBuilder>?.Func helpBuilderFactory = null, TryReplaceToken? tokenReplacer = null ) : System.Collections.Generic
command System.CommandLine.Command The root command for the parser.
enablePosixBundling bool to enable POSIX bundling; otherwise, .
enableDirectives bool to enable directive parsing; otherwise, .
enableTokenReplacement bool to enable token replacement; otherwise, .
resources LocalizationResources? Provide custom validation messages.
middlewarePipeline IReadOnlyList? Provide a custom middleware pipeline.
helpBuilderFactory HelpBuilder>?.Func Provide a custom help builder.
tokenReplacer TryReplaceToken? Replaces the specified token with any number of other tokens.
Результат System.Collections.Generic

ThrowIfInvalid() публичный Метод

Throws an exception if the parser configuration is ambiguous or otherwise not valid.
Due to the performance cost of this method, it is recommended to be used in unit testing or in scenarios where the parser is configured dynamically at runtime.
Thrown if the configuration is found to be invalid.
public ThrowIfInvalid ( ) : void
Результат void