Table of Contents

Class TigerQueryCliContribution

Namespace
ItTiger.TigerQuery.CliCore
Assembly
ItTiger.TigerQuery.CliCore.dll
Contributes TigerQuery's --tq-connection-store-file global option, and help metadata for the connection-store environment variable, to a TigerCli application.
public sealed class TigerQueryCliContribution : ITigerCliAppContribution
Inheritance
TigerQueryCliContribution
Implements
ITigerCliAppContribution
Inherited Members

Remarks

Register one instance with TigerCliAppBuilder.AddContribution(...) and give its Options to TigerQuery and to every host command or service that reads connections. Registering the contribution and mounting the connections command group are separate opt-ins: an app can accept the option for its own commands without the group, or mount the group without the option.

TigerCli owns the mechanics — name validation, parsing, rejecting a repeated occurrence or a missing value, help placement, and invoking the callback exactly once per command run with null when the option is absent. This type owns only what the option means: it hands the value to SqlServerConnectionStorePathResolver and records the result on Options. TigerCli never reads the environment variable; the registration below is help text, and the lookup belongs to the resolver.

The option follows TigerCli's grammar despite being app-wide in meaning: write it after the command path and any positional arguments, and use --tq-connection-store-file=<path> when the path begins with -.

Constructors

TigerQueryCliContribution(TigerQueryCliOptions)

Initializes the contribution over host-owned, run-shared state.
public TigerQueryCliContribution(TigerQueryCliOptions options)

Parameters

options TigerQueryCliOptions
The state this contribution fills in and the rest of the application reads.

Exceptions

ArgumentNullException
options is null.

Fields

ConnectionStoreFileOption

The canonical long name of the contributed store-path option.
public const string ConnectionStoreFileOption = "--tq-connection-store-file"

Field Value

string

Properties

Options

Gets the state the callback writes to and the application reads from.
public TigerQueryCliOptions Options { get; }

Property Value

TigerQueryCliOptions

Methods

Configure(TigerCliAppContributionBuilder)

Registers the store-path option and the environment-variable help entry.
public void Configure(TigerCliAppContributionBuilder builder)

Parameters

builder TigerCliAppContributionBuilder
The contribution-scoped app configuration builder.

Remarks

TigerCli calls this during Build(), which is where a duplicate option name or a duplicate environment-variable name fails. A host that already registered ConnectionStoreFile itself must drop that registration when it adopts this contribution. TigerCli 0.9.2 resolves both contributed descriptions through the app resource manager at help-render time.

Exceptions

ArgumentNullException
builder is null.