API Reference
Class
TextPrompt
A line of text: a default (shown as a hint, accepted with Enter on an empty line, Tab puts it in the box to edit), a placeholder, required/length/pattern checks and a custom validator with an inline error, and history on Up/Down.
Inheritance
- Prompt<String>
- TextPrompt
Constructors
Methods
public override String Describe(String value) #Returns:
StringThe answer as text, for the summary line left in the scrollback.
Parameters
- value System.String
- The answer.
Returns
The text.
Inherited Methods
public virtual Boolean Equals(Object? obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object?
public String Show(InteractiveOptions? options = null, CancellationToken cancellationToken = default) #Returns:
StringInherited from 0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
Parameters
- options InteractiveOptions? = null
- cancellationToken CancellationToken = default
public Task<String> ShowAsync(InteractiveOptions? options = null, CancellationToken cancellationToken = default) #Returns:
Task<String>Inherited from 0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
Parameters
- options InteractiveOptions? = null
- cancellationToken CancellationToken = default
public Boolean TryShow(out String value, InteractiveOptions? options = null, CancellationToken cancellationToken = default) #Returns:
BooleanInherited from 0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
Parameters
- value String
- options InteractiveOptions? = null
- cancellationToken CancellationToken = default
Properties
public Boolean Required { get; set; } #Whether an empty answer is refused (when there is no default).
public String? PatternMessage { get; set; } #The message when TextPrompt.Pattern does not match.
public Func<String, String?>? Validator { get; set; } #A validator: returns an error message, or null when the answer is fine.
public IList<String> History { get; } #Earlier answers offered with Up and Down (oldest first).
public Boolean PrefillDefault { get; set; } #Starts with the default in the box (editable) instead of showing it as a hint.
Inherited Properties
public String Title { get; set; } #Inherited from 0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
public String? Description { get; set; } #Inherited from 0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
public String? ParameterName { get; set; } #Inherited from 0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
public Boolean HasDefault { get; } #Inherited from 0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
public String Default { get; set; } #Inherited from 0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]