PathPrompt
ConsoleMonster.Interactive
A file or folder path with completion: matching entries of the typed folder are listed under the box (folders first), Tab completes the common part or the focused entry, Up/Down move through the suggestions, and Enter checks that the path exists and is the right kind when required.
Inheritance
- Prompt<string>
- PathPrompt
Usage
Explore 45 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 23
- Extension method PathPrompt.BasePath
- Extension method PathPrompt.Default
- Extension method PathPrompt.Description
- Extension method PathPrompt.Extension
- Extension method PathPrompt.Extensions
- Extension method PathPrompt.Kind
- Extension method PathPrompt.MustExist
- Extension method PathPrompt.ParameterName
- Extension method PathPrompt.ShowHidden
- Extension method PathPrompt.Suggestions
- Extension method PathPrompt.Title
- Method PathPromptFluent.BasePath
- Method PathPromptFluent.Default
- Method PathPromptFluent.Description
- Method PathPromptFluent.Extension
- Method PathPromptFluent.Extensions
- Method PathPromptFluent.Kind
- Method PathPromptFluent.MustExist
- Method PathPromptFluent.ParameterName
- Method PathPromptFluent.ShowHidden
- Method PathPromptFluent.Suggestions
- Method PathPromptFluent.Title
- Method Ui.PathPrompt
Accepted by parameters 22
- Extension method PathPrompt.BasePath
- Extension method PathPrompt.Default
- Extension method PathPrompt.Description
- Extension method PathPrompt.Extension
- Extension method PathPrompt.Extensions
- Extension method PathPrompt.Kind
- Extension method PathPrompt.MustExist
- Extension method PathPrompt.ParameterName
- Extension method PathPrompt.ShowHidden
- Extension method PathPrompt.Suggestions
- Extension method PathPrompt.Title
- Method PathPromptFluent.BasePath
- Method PathPromptFluent.Default
- Method PathPromptFluent.Description
- Method PathPromptFluent.Extension
- Method PathPromptFluent.Extensions
- Method PathPromptFluent.Kind
- Method PathPromptFluent.MustExist
- Method PathPromptFluent.ParameterName
- Method PathPromptFluent.ShowHidden
- Method PathPromptFluent.Suggestions
- Method PathPromptFluent.Title
Constructors
Methods
public override string Describe(string value) #The answer as text, for the summary line left in the scrollback.
Parameters
- value string
- The answer.
Returns
string The text.Inherited Methods
public virtual string Show(InteractiveOptions? options = null, CancellationToken cancellationToken = default) #Parameters
- options InteractiveOptions? = null
- cancellationToken CancellationToken = default
Returns
stringpublic Task<string> ShowAsync(InteractiveOptions? options = null, CancellationToken cancellationToken = default) #Parameters
- options InteractiveOptions? = null
- cancellationToken CancellationToken = default
Returns
Task<string>public IWidget Snapshot(InteractiveOptions? options = null) #Parameters
- options InteractiveOptions? = null
Returns
IWidgetpublic bool TryShow(out string value, InteractiveOptions? options = null, CancellationToken cancellationToken = default) #Parameters
- value string
- options InteractiveOptions? = null
- cancellationToken CancellationToken = default
Returns
boolProperties
Inherited Properties
public string Title { get; set; } #public string? Description { get; set; } #public string? ParameterName { get; set; } #public bool HasDefault { get; } #Extension Methods
public static PathPrompt BasePath(PathPrompt pathPrompt, string? value) #Sets PathPrompt.BasePath: The folder relative paths start from; null uses the current directory.
Parameters
- pathPrompt ConsoleMonster.Interactive.PathPrompt
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
pathPrompt.BasePath = value; Ui.PathPrompt().BasePath(value);public static PathPrompt Default(PathPrompt pathPrompt, string value) #Sets Prompt<string>.Default: The default answer: pre-selected, accepted with Enter, and returned in non-interactive sessions.
Parameters
- pathPrompt ConsoleMonster.Interactive.PathPrompt
- The instance.
- value string
- The value.
Examples
// C# initializer or property // C# fluent
pathPrompt.Default = value; Ui.PathPrompt().Default(value);public static PathPrompt Description(PathPrompt pathPrompt, string? value) #Sets Prompt<string>.Description: Help text under the question.
Parameters
- pathPrompt ConsoleMonster.Interactive.PathPrompt
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
pathPrompt.Description = value; Ui.PathPrompt().Description(value);public static PathPrompt Extension(PathPrompt pathPrompt, string item) #Adds an item to PathPrompt.Extensions: File extensions offered as suggestions (".csv", ".json"); empty offers every file.
Parameters
- pathPrompt ConsoleMonster.Interactive.PathPrompt
- The instance.
- item string
- The item.
public static PathPrompt Extensions(PathPrompt pathPrompt, IEnumerable<string> items) #Adds items to PathPrompt.Extensions: File extensions offered as suggestions (".csv", ".json"); empty offers every file.
Parameters
- pathPrompt ConsoleMonster.Interactive.PathPrompt
- The instance.
- items System.Collections.Generic.IEnumerable<string>
- The items, in order.
public static PathPrompt Kind(PathPrompt pathPrompt, PathKind value) #Sets PathPrompt.Kind: What is accepted.
Parameters
- pathPrompt ConsoleMonster.Interactive.PathPrompt
- The instance.
- value ConsoleMonster.Interactive.PathKind
- The value.
Examples
// C# initializer or property // C# fluent
pathPrompt.Kind = value; Ui.PathPrompt().Kind(value);public static PathPrompt MustExist(PathPrompt pathPrompt, bool value = true) #Sets PathPrompt.MustExist: Whether the path must exist.
Parameters
- pathPrompt ConsoleMonster.Interactive.PathPrompt
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
pathPrompt.MustExist = value; Ui.PathPrompt().MustExist(value);public static PathPrompt ParameterName(PathPrompt pathPrompt, string? value) #Sets Prompt<string>.ParameterName: The parameter that supplies this value non-interactively (-Domain, --domain); named in the non-interactive error message.
Parameters
- pathPrompt ConsoleMonster.Interactive.PathPrompt
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
pathPrompt.ParameterName = value; Ui.PathPrompt().ParameterName(value);public static PathPrompt Suggestions(PathPrompt pathPrompt, int value) #Sets PathPrompt.Suggestions: How many suggestions are listed.
Parameters
- pathPrompt ConsoleMonster.Interactive.PathPrompt
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
pathPrompt.Suggestions = value; Ui.PathPrompt().Suggestions(value);public static PathPrompt Title(PathPrompt pathPrompt, string value) #Sets Prompt<string>.Title: The question.
Parameters
- pathPrompt ConsoleMonster.Interactive.PathPrompt
- The instance.
- value string
- The value.
Examples
// C# initializer or property // C# fluent
pathPrompt.Title = value; Ui.PathPrompt().Title(value);