Skip to content
ConsoleMonster

API Reference

Class

SecretPrompt

Namespace ConsoleMonster.Interactive
Assembly ConsoleMonster
Base Prompt<String>
Modifiers sealed

A secret (password, token): masked or hidden while typed, with Ctrl+R to reveal it for a moment, required by default. The answer never appears in summaries, logs or presets.

Inheritance

  • Prompt<String>
  • SecretPrompt

Constructors

public SecretPrompt(String title) #

Creates a secret prompt.

Parameters

title System.String requiredposition: 0
The question.

Methods

public override String Describe(String value) #
Returns: String

The answer as text, for the summary line left in the scrollback.

Parameters

value System.String requiredposition: 0
The answer.

Returns

The text.

Properties

public SecretDisplay Display { get; set; } #

How the secret is shown while typed.

public Boolean AllowReveal { get; set; } #

Whether Ctrl+R can reveal the typed text.

public Boolean Required { get; set; } #

Whether an empty answer is refused.

public Int32 MinLength { get; set; } #

The fewest characters accepted.

public Func<String, String?>? Validator { get; set; } #

A validator: returns an error message, or null.