Skip to content

ParsingOptions

Parsing configuration.

public sealed class ParsingOptions

AddGlobalOption(string, string, string[]?, string?)

Section titled “AddGlobalOption(string, string, string[]?, string?)”

Registers a custom global option using a type or constraint name (for example: “int”, “guid”, “bool”, or a registered custom route constraint name).

public void AddGlobalOption(string name, string constraintOrTypeName, string[]? aliases = null, string? defaultValue = null)
  • name (string): Canonical name without prefix (for example: “tenant”).
  • constraintOrTypeName (string): Built-in type name (“string”, “int”, “long”, “bool”, “guid”, “uri”, “date”, “datetime”, “timespan”) or a registered custom route constraint name. Custom constraints resolve to string.
  • aliases (string[]): Optional aliases. Values without prefix are normalized to --alias.
  • defaultValue (string): Optional default value as string.

AddGlobalOption(string, string, string[]?, string?, string)

Section titled “AddGlobalOption(string, string, string[]?, string?, string)”

Registers a custom global option (by type or constraint name) with an explicit help description.

public void AddGlobalOption(string name, string constraintOrTypeName, string[]? aliases, string? defaultValue, string description)
  • name (string): Canonical name without prefix (for example: “tenant”).
  • constraintOrTypeName (string): Built-in type name (“string”, “int”, “long”, “bool”, “guid”, “uri”, “date”, “datetime”, “timespan”) or a registered custom route constraint name. Custom constraints resolve to string.
  • aliases (string[]): Aliases (pass null for none). Values without prefix are normalized to --alias.
  • defaultValue (string): Default value as string (pass null for none).
  • description (string): Description shown in help output.

Registers a custom global option consumed before command routing.

public void AddGlobalOption<T>(string name, string[]? aliases = null, T? defaultValue = default)
  • T: Declared value type.
  • name (string): Canonical name without prefix (for example: “tenant”).
  • aliases (string[]): Optional aliases. Values without prefix are normalized to --alias.
  • defaultValue (T): Optional default value metadata. Ignored when T is a collection, which one text default cannot represent.

AddGlobalOption<T>(string, string[]?, T?, string)

Section titled “AddGlobalOption<T>(string, string[]?, T?, string)”

Registers a custom global option with an explicit help description.

public void AddGlobalOption<T>(string name, string[]? aliases, T? defaultValue, string description)
  • T: Declared value type.
  • name (string): Canonical name without prefix (for example: “tenant”).
  • aliases (string[]): Aliases (pass null for none). Values without prefix are normalized to --alias.
  • defaultValue (T): Default value metadata (pass default for none). Ignored when T is a collection, which one text default cannot represent.
  • description (string): Description shown in help output.

AddRouteConstraint(string, Func<string, bool>)

Section titled “AddRouteConstraint(string, Func<string, bool>)”

Registers a custom route constraint predicate.

public void AddRouteConstraint(string name, Func<string, bool> predicate)
  • name (string): Constraint name.
  • predicate (Func<string, bool>): Predicate used to validate route segment input.

Selects a registered global option for discovery metadata configuration.

public GlobalOptionBuilder GlobalOption(string name)
  • name (string): Canonical option name, with or without the -- prefix.

GlobalOptionBuilder - A global-option metadata builder.

Gets or sets a value indicating whether response files (for example: @args.rsp) are expanded.

public bool AllowResponseFiles { get; set; }

bool

Gets or sets a value indicating whether unknown options are allowed.

public bool AllowUnknownOptions { get; set; }

bool

Gets or sets the culture mode used for numeric conversions.

public NumericParsingCulture NumericCulture { get; set; }

NumericParsingCulture

Gets or sets option-name case-sensitivity mode.

public ReplCaseSensitivity OptionCaseSensitivity { get; set; }

ReplCaseSensitivity