Table of Contents

Class TigerCliPromptPropertyBuilder<TSettings, TValue>

Namespace
ItTiger.TigerCli.Commands
Assembly
ItTiger.TigerCli.dll
Registers a provider-backed prompt for one property selected from TigerCliPromptConfiguration<TSettings>.
public sealed class TigerCliPromptPropertyBuilder<TSettings, TValue> where TSettings : TigerCliSettings

Type Parameters

TSettings
The command settings type.
TValue
The provider key and target property value type.
Inheritance
TigerCliPromptPropertyBuilder<TSettings, TValue>
Inherited Members

Remarks

The registered provider is keyed to the targeted property name. When the property is prompted, TigerCli invokes the provider with the current settings instance and a TigerCliPromptContext containing previously bound or prompted values. The returned OptionItem<TKey> keys are the values bound back to the property; labels are display text. Provider choices must not be null, contain null keys, or contain duplicate keys.

Methods

SelectFrom(Func<TSettings, TigerCliPromptContext, IReadOnlyList<OptionItem<TValue>>>, IEnumerable<string>?)

Registers a synchronous key/label choice provider for the targeted property.
public void SelectFrom(Func<TSettings, TigerCliPromptContext, IReadOnlyList<OptionItem<TValue>>> provider, IEnumerable<string>? dependsOn = null)

Parameters

provider Func<TSettings, TigerCliPromptContext, IReadOnlyList<OptionItem<TValue>>>
Provider invoked during prompt/provider validation. It receives the current settings and prompt context, and returns selectable values for the property.
dependsOn IEnumerable<string>
Optional prompt-order hints naming other options by alias or property name. These affect prompt ordering only; they do not make this property required and they do not perform validation.

Exceptions

ArgumentNullException
provider is null.

SelectFrom(Func<TSettings, TigerCliPromptContext, Task<IReadOnlyList<OptionItem<TValue>>>>, IEnumerable<string>?)

Registers an asynchronous key/label choice provider for the targeted property.
public void SelectFrom(Func<TSettings, TigerCliPromptContext, Task<IReadOnlyList<OptionItem<TValue>>>> provider, IEnumerable<string>? dependsOn = null)

Parameters

provider Func<TSettings, TigerCliPromptContext, Task<IReadOnlyList<OptionItem<TValue>>>>
Provider invoked during prompt/provider validation. It receives the current settings and prompt context, and returns selectable values for the property.
dependsOn IEnumerable<string>
Optional prompt-order hints naming other options by alias or property name. These affect prompt ordering only; they do not make this property required and they do not perform validation.

Exceptions

ArgumentNullException
provider is null.