Skip to content

ReplOptionAttribute

Configures named option metadata for a handler parameter.

[AttributeUsage(AttributeTargets.Property|AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)]
public sealed class ReplOptionAttribute : Attribute

Additional option aliases as full tokens (for example: --mode, -m).

public string[] Aliases { get; set; }

string[]

Optional arity override. Only an explicit assignment overrides the arity inferred from the parameter shape; when unset, the getter returns the enum default and does not reflect the effective arity — read ArityOverride to distinguish unset from an explicit value. An explicit ExactlyOne or OneOrMore requires a value, so mapping a command fails when a handler parameter also declares a default value, which could never apply. An options-group property’s initializer cannot be detected and is not used under such an arity.

public ReplArity Arity { get; set; }

ReplArity

Explicit arity override, or null to use the arity inferred from the parameter shape.

public ReplArity? ArityOverride { get; }

ReplArity?

Gets or sets a value indicating whether the option is hidden from programmatic surfaces only.

public bool AutomationHidden { get; set; }

bool

Optional case-sensitivity override for this option. Only an explicit assignment overrides the global parsing default; when unset, the getter returns the enum default and does not reflect the effective behavior — read CaseSensitivityOverride to distinguish unset from an explicit value.

public ReplCaseSensitivity CaseSensitivity { get; set; }

ReplCaseSensitivity

Explicit case-sensitivity override, or null to inherit the global default.

public ReplCaseSensitivity? CaseSensitivityOverride { get; }

ReplCaseSensitivity?

Gets or sets a value indicating whether the option is hidden from every discovery surface: help, interactive and shell completion including value providers, exported documentation, and generated MCP tool and prompt schemas.

public bool Hidden { get; set; }

bool

Legacy aliases that remain accepted by parsing and binding but are omitted from every discovery surface. Values are full tokens (for example: --old-mode or -o).

public string[] HiddenAliases { get; set; }

string[]

Binding mode for the parameter.

public ReplParameterMode Mode { get; set; }

ReplParameterMode

Canonical option name without prefix.

public string? Name { get; set; }

string

Reverse aliases as full tokens (for example: --no-verbose).

public string[] ReverseAliases { get; set; }

string[]