Class TigerQueryCliContribution
- Namespace
- ItTiger.TigerQuery.CliCore
- Assembly
- ItTiger.TigerQuery.CliCore.dll
--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)
public TigerQueryCliContribution(TigerQueryCliOptions options)
Parameters
optionsTigerQueryCliOptions- The state this contribution fills in and the rest of the application reads.
Exceptions
- ArgumentNullException
optionsis null.
Fields
ConnectionStoreFileOption
public const string ConnectionStoreFileOption = "--tq-connection-store-file"
Field Value
Properties
Options
public TigerQueryCliOptions Options { get; }
Property Value
Methods
Configure(TigerCliAppContributionBuilder)
public void Configure(TigerCliAppContributionBuilder builder)
Parameters
builderTigerCliAppContributionBuilder- The contribution-scoped app configuration builder.
Remarks
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
builderis null.