Class TigerCliGlobalOptionBuilder
Registers simple app-wide global options supplied by app contributions. Options use one
constrained shape: an optional string value with one canonical long option name.
public sealed class TigerCliGlobalOptionBuilder
- Inheritance
-
TigerCliGlobalOptionBuilder
- Inherited Members
Methods
AddOptionalString(string, string, string, Func<TigerCliGlobalOptionContext, string?, TigerCliValidationResult>)
Adds an optional, CLI-only string global option. The option is app-wide in meaning but follows
TigerCli's command-line grammar, appearing after the command path and positional arguments with
other options. It appears in root and command help, is never prompted, and invokes
apply once per command run with null when absent. Return a validation
error to stop the run before command binding and execution.public TigerCliGlobalOptionBuilder AddOptionalString(string name, string valueName, string description, Func<TigerCliGlobalOptionContext, string?, TigerCliValidationResult> apply)
Parameters
namestring- The canonical long name, beginning with
--. valueNamestring- The value placeholder displayed in help, such as
path. descriptionstring- The help description. TigerCli markup is supported.
applyFunc<TigerCliGlobalOptionContext, string, TigerCliValidationResult>- Applies the parsed value to contribution-owned state and optionally validates it. The value is
nullwhen the option was not supplied.
Returns
- TigerCliGlobalOptionBuilder
- This builder for chaining.
Exceptions
- ArgumentException
valueNameordescriptionis null, empty, or whitespace.- ArgumentNullException
applyisnull.- InvalidOperationException
nameis not a canonical long name, contains whitespace, is reserved by TigerCli, or duplicates another contributed global option.
AddOptionalString(string, string, string, Func<TigerCliGlobalOptionContext, string?, TigerCliValidationResult>, string?)
Adds an optional, CLI-only string global option with a localizable help description. The
option follows TigerCli's command-line grammar, appears in root and command help, is never
prompted, and invokes
apply once per command run with null when
absent. Return a validation error to stop the run before command binding and execution.public TigerCliGlobalOptionBuilder AddOptionalString(string name, string valueName, string description, Func<TigerCliGlobalOptionContext, string?, TigerCliValidationResult> apply, string? descriptionResourceKey = null)
Parameters
namestring- The canonical long name, beginning with
--. valueNamestring- The literal value placeholder displayed in help, such as
path. descriptionstring- Fallback help description used when the resource key is absent or does not resolve. TigerCli markup is supported.
applyFunc<TigerCliGlobalOptionContext, string, TigerCliValidationResult>- Applies the parsed value to contribution-owned state and optionally validates it. The value is
nullwhen the option was not supplied. descriptionResourceKeystring- Optional resource key resolved through the app
ResourceManager registered via
TigerCliAppBuilder.UseAppResources(...)against the active run culture. Missing or empty resource values silently fall back todescription.
Returns
- TigerCliGlobalOptionBuilder
- This builder for chaining.
Exceptions
- ArgumentException
valueNameordescriptionis null, empty, or whitespace.- ArgumentNullException
applyisnull.- InvalidOperationException
nameis not a canonical long name, contains whitespace, is reserved by TigerCli, or duplicates another contributed global option.