System.CommandLine.CommandLineConfiguration.CommandLineConfiguration C# (CSharp) Method

CommandLineConfiguration() public method

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.
return System.Collections.Generic
        public CommandLineConfiguration(
            Command command,
            bool enablePosixBundling = true,
            bool enableDirectives = true,
            bool enableTokenReplacement = true,
            LocalizationResources? resources = null,
            IReadOnlyList<InvocationMiddleware>? middlewarePipeline = null,
            Func<BindingContext, HelpBuilder>? helpBuilderFactory = null,
            TryReplaceToken? tokenReplacer = null)
        {
            RootCommand = command ?? throw new ArgumentNullException(nameof(command));
            EnableTokenReplacement = enableTokenReplacement;
            EnablePosixBundling = enablePosixBundling;
            EnableDirectives = enableDirectives;

            LocalizationResources = resources ?? LocalizationResources.Instance;
            Middleware = middlewarePipeline ?? Array.Empty<InvocationMiddleware>();

            _helpBuilderFactory = helpBuilderFactory;
            _tokenReplacer = tokenReplacer;
        }