Class TigerCliMultiSelectAttribute
Marks a collection command option as a multi-select. TigerCli then treats the option as
"select zero or more values" sourced from the option's value provider, in the same spirit as
TigerCliFolderSelectAttribute.
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public sealed class TigerCliMultiSelectAttribute : Attribute
- Inheritance
-
TigerCliMultiSelectAttribute
- Inherited Members
Remarks
Apply this alongside TigerCliOptionAttribute on the same property. The provider is
resolved exactly like a single-select provider option (via Provider
or a property-name provider registered with ConfigureProviders / group / command AddProvider).
Supported property types are List<T> and T[] where T is string,
int, short, long, or Guid. String collections model a simple list of
values; the others model key/label choices where the provider returns OptionItem<T>
(a display label per selectable key) and the selected keys are bound back into the collection.
- Non-interactive: the value is a comma-separated list (and/or a repeated
option, e.g.
--x a,bor--x a --x b). Each token is matched against the provider's choices by key or label using ValueMatching; the matched provider key is bound, not the raw token. Unless AllowCustomValues is set (string collections only), unknown tokens are rejected with a validation error. - Semi-interactive: a missing value is prompted with the inline multi-select
checklist (
InlineMultiSelect). The property's current value seeds the preselection, and selected provider keys are bound in choice order.
An empty selection is allowed by default; set AllowEmpty to false to require at
least one value when the option is prompted or supplied.
Properties
AllowCustomValues
When true, command-line tokens that do not match any provider choice are kept as-is instead of
being rejected. Only valid for
string collections; setting it on a keyed collection is a
configuration error.public bool AllowCustomValues { get; set; }
Property Value
AllowEmpty
Whether a zero-length selection is accepted. Defaults to
true. When false, an empty result
(no tokens supplied, or nothing picked in the checklist) is rejected as a validation error.public bool AllowEmpty { get; set; }