Skip to content

AskSecretOptions

Options for AskSecretAsync(string, string, AskSecretOptions?).

public record AskSecretOptions : IEquatable<AskSecretOptions>
  • IEquatable<AskSecretOptions>

AskSecretOptions(TimeSpan?, char?, bool, CancellationToken)

Section titled “AskSecretOptions(TimeSpan?, char?, bool, CancellationToken)”

Options for AskSecretAsync(string, string, AskSecretOptions?).

public AskSecretOptions(TimeSpan? Timeout = null, char? Mask = '*', bool AllowEmpty = false, CancellationToken CancellationToken = default)
  • Timeout (TimeSpan?): Optional timeout for the prompt. When the timeout elapses, an empty string is returned and a countdown is displayed inline.
  • Mask (char?): Character used to echo each typed character. Use '*' for asterisks or null for invisible (no echo).
  • AllowEmpty (bool): When false, the prompt loops until a non-empty value is entered.
  • CancellationToken (CancellationToken): Explicit cancellation token. When default, the channel uses the ambient per-command token set by the framework before each command dispatch.

When false, the prompt loops until a non-empty value is entered.

public bool AllowEmpty { get; init; }

bool

Explicit cancellation token. When default, the channel uses the ambient per-command token set by the framework before each command dispatch.

public CancellationToken CancellationToken { get; init; }

CancellationToken

Character used to echo each typed character. Use '*' for asterisks or null for invisible (no echo).

public char? Mask { get; init; }

char?

Optional timeout for the prompt. When the timeout elapses, an empty string is returned and a countdown is displayed inline.

public TimeSpan? Timeout { get; init; }

TimeSpan?