Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Commit ad69005

Browse files
committed
Implement label based filtering
1 parent dbef130 commit ad69005

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

packages/jumpstarter-cli-client/jumpstarter_cli_client/client_exporter.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import asyncclick as click
2-
from jumpstarter_cli_common import OutputMode, OutputType, make_table, opt_output_all
2+
from jumpstarter_cli_common import OutputMode, OutputType, make_table, opt_labels, opt_output_all
33
from jumpstarter_cli_common.exceptions import handle_exceptions
44

55
from jumpstarter.config import (
@@ -10,9 +10,10 @@
1010

1111
@click.command("list-exporters", short_help="List available exporters.")
1212
@click.argument("name", type=str, default="")
13+
@opt_labels
1314
@opt_output_all
1415
@handle_exceptions
15-
def list_client_exporters(name: str | None, output: OutputType):
16+
def list_client_exporters(name: str | None, labels: list[(str, str)], output: OutputType):
1617
if name:
1718
config = ClientConfigV1Alpha1.load(name)
1819
else:
@@ -23,7 +24,7 @@ def list_client_exporters(name: str | None, output: OutputType):
2324
param_hint="name",
2425
)
2526

26-
exporters = config.list_exporters()
27+
exporters = config.list_exporters(filter=",".join("{}={}".format(i[0], i[1]) for i in labels))
2728

2829
if output == OutputMode.JSON:
2930
click.echo(exporters.dump_json())

0 commit comments

Comments
 (0)