Class TigerCliPromptContext
Context passed to prompt and provider callbacks while TigerCli is resolving provider-backed values.
public sealed class TigerCliPromptContext
- Inheritance
-
TigerCliPromptContext
- Inherited Members
Remarks
The context exposes the effective shell, interaction mode, timeout, cancellation token, culture,
and values already available from earlier binding or prompting. Value lookup is intended for
dependent providers that need to read selector values or earlier option answers.
Properties
CancellationToken
The effective cancellation token for prompt/provider work. Provider callbacks should observe it
cooperatively; an OperationCanceledException thrown while this token is cancelled
is treated as cancellation rather than provider failure.
public CancellationToken CancellationToken { get; }
Property Value
Culture
The active run culture as resolved by the framework. Provider callbacks can
use this to return localized labels without mutating
CurrentUICulture.
public CultureInfo Culture { get; }
Property Value
InteractionMode
The effective interaction mode for the command being resolved.
public TigerCliInteractionMode InteractionMode { get; }
Property Value
Shell
The injected prompt shell for the current run, or
null when TigerCli is using its default
console-backed shell.public ICliAppShell? Shell { get; }
Property Value
Timeout
The optional prompt inactivity timeout passed to the run pipeline.
public TimeSpan? Timeout { get; }
Property Value
Methods
GetOptionValue<TValue>(string)
Reads an already-bound or already-prompted value by name, returning
default when no
matching value exists or the value is not assignable to TValue.public TValue? GetOptionValue<TValue>(string name)
Parameters
namestring- The lookup name. For options this may be an alias such as
--fileor the property name.
Returns
- TValue
Type Parameters
TValue
TryGetValue<TValue>(string, out TValue?)
Attempts to read an already-bound or already-prompted value by option alias, normalized alias,
argument/display name, normalized display name, or settings property name.
public bool TryGetValue<TValue>(string name, out TValue? value)
Parameters
namestring- The lookup name. For options this may be an alias such as
--fileor the property name. valueTValue- The typed value when present and assignable to
TValue.
Returns
- bool
truewhen a matching value exists and is assignable toTValue.
Type Parameters
TValue
Exceptions
- ArgumentException
nameis null, empty, or whitespace.