Table of Contents

Class TigerCliPromptContext

Namespace
ItTiger.TigerCli.Commands
Assembly
ItTiger.TigerCli.dll
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

CancellationToken

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

CultureInfo

InteractionMode

The effective interaction mode for the command being resolved.
public TigerCliInteractionMode InteractionMode { get; }

Property Value

TigerCliInteractionMode

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

ICliAppShell

Timeout

The optional prompt inactivity timeout passed to the run pipeline.
public TimeSpan? Timeout { get; }

Property Value

TimeSpan?

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

name string
The lookup name. For options this may be an alias such as --file or 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

name string
The lookup name. For options this may be an alias such as --file or the property name.
value TValue
The typed value when present and assignable to TValue.

Returns

bool
true when a matching value exists and is assignable to TValue.

Type Parameters

TValue

Exceptions

ArgumentException
name is null, empty, or whitespace.