diff --git a/packages/jumpstarter-cli/jumpstarter_cli/common.py b/packages/jumpstarter-cli/jumpstarter_cli/common.py index 5e9bbe719..ffa90bdff 100644 --- a/packages/jumpstarter-cli/jumpstarter_cli/common.py +++ b/packages/jumpstarter-cli/jumpstarter_cli/common.py @@ -5,11 +5,18 @@ from pydantic import TypeAdapter, ValidationError from pytimeparse2 import parse as parse_duration + +def _opt_selector_callback(_ctx, _param, value): + """Combine multiple selector values into a single comma-separated string.""" + return ",".join(value) if value else None + opt_selector = click.option( "-l", "--selector", + multiple=True, + callback=_opt_selector_callback, help="Selector (label query) to filter on, supports '=', '==', and '!=' (e.g. -l key1=value1,key2=value2)." - " Matching objects must satisfy all of the specified label constraints.", + " Matching objects must satisfy all of the specified label constraints. Can be specified multiple times.", )