Skip to content

Commit 0cb0845

Browse files
authored
Merge pull request #13 from simvue-io/hotfix/fix-format-artifact-list
Fix artifact list
2 parents a7e6933 + b26bb99 commit 0cb0845

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/simvue_cli/cli/__init__.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,6 +1515,7 @@ def delete_storage(ctx, storage_ids: list[str] | None, interactive: bool) -> Non
15151515
@click.pass_context
15161516
@click.option(
15171517
"--format",
1518+
"table_format",
15181519
type=click.Choice(list(tabulate._table_formats.keys())),
15191520
help="Display as table with output format",
15201521
default=None,
@@ -1542,7 +1543,7 @@ def delete_storage(ctx, storage_ids: list[str] | None, interactive: bool) -> Non
15421543
@click.option("--enabled", is_flag=True, help="Show if storage is enabled")
15431544
def list_storages(
15441545
ctx,
1545-
format: str,
1546+
table_format: str,
15461547
backend: bool,
15471548
tenant_usable: bool,
15481549
default: bool,
@@ -1572,7 +1573,7 @@ def list_storages(
15721573
storages,
15731574
plain_text=ctx.obj["plain"],
15741575
enumerate_=enumerate_,
1575-
format=format,
1576+
format=table_format,
15761577
)
15771578
click.echo(table)
15781579

@@ -1616,6 +1617,7 @@ def simvue_artifact(ctx):
16161617
@click.pass_context
16171618
@click.option(
16181619
"--format",
1620+
"table_format",
16191621
type=click.Choice(list(tabulate._table_formats.keys())),
16201622
help="Display as table with output format",
16211623
default=None,
@@ -1663,10 +1665,9 @@ def simvue_artifact(ctx):
16631665
show_default=True,
16641666
)
16651667
@click.option("--reverse", help="Reverse ordering", default=False, is_flag=True)
1666-
@click.pass_context
16671668
def artifact_list(
16681669
ctx,
1669-
format_: str,
1670+
table_format: str | None,
16701671
enumerate_: bool,
16711672
original_path: bool,
16721673
storage: bool,
@@ -1707,7 +1708,7 @@ def artifact_list(
17071708
storages,
17081709
plain_text=ctx.obj["plain"],
17091710
enumerate_=enumerate_,
1710-
format=format,
1711+
format=table_format,
17111712
)
17121713
click.echo(table)
17131714

tests/test_command_line_interface.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,9 @@ def test_artifact_list(create_test_run: tuple[simvue.Run, dict]) -> None:
337337
"--mime-type",
338338
"--count=20",
339339
"--enumerate",
340-
f"--format=simple"
341-
]
340+
"--format=simple"
341+
],
342+
catch_exceptions=False
342343
)
343344
assert result.exit_code == 0, result.output
344345
assert run_data["file_1"] in result.output

0 commit comments

Comments
 (0)