diff --git a/src/simvue_cli/cli/__init__.py b/src/simvue_cli/cli/__init__.py index 9851088..7c6c27c 100644 --- a/src/simvue_cli/cli/__init__.py +++ b/src/simvue_cli/cli/__init__.py @@ -1518,6 +1518,7 @@ def delete_storage(ctx, storage_ids: list[str] | None, interactive: bool) -> Non @click.pass_context @click.option( "--format", + "table_format", type=click.Choice(list(tabulate._table_formats.keys())), help="Display as table with output format", default=None, @@ -1545,7 +1546,7 @@ def delete_storage(ctx, storage_ids: list[str] | None, interactive: bool) -> Non @click.option("--enabled", is_flag=True, help="Show if storage is enabled") def list_storages( ctx, - format: str, + table_format: str, backend: bool, tenant_usable: bool, default: bool, @@ -1575,7 +1576,7 @@ def list_storages( storages, plain_text=ctx.obj["plain"], enumerate_=enumerate_, - format=format, + format=table_format, ) click.echo(table) @@ -1619,6 +1620,7 @@ def simvue_artifact(ctx): @click.pass_context @click.option( "--format", + "table_format", type=click.Choice(list(tabulate._table_formats.keys())), help="Display as table with output format", default=None, @@ -1666,10 +1668,9 @@ def simvue_artifact(ctx): show_default=True, ) @click.option("--reverse", help="Reverse ordering", default=False, is_flag=True) -@click.pass_context def artifact_list( ctx, - format_: str, + table_format: str | None, enumerate_: bool, original_path: bool, storage: bool, @@ -1710,7 +1711,7 @@ def artifact_list( storages, plain_text=ctx.obj["plain"], enumerate_=enumerate_, - format=format, + format=table_format, ) click.echo(table) diff --git a/tests/test_command_line_interface.py b/tests/test_command_line_interface.py index 35acbbb..044f93e 100644 --- a/tests/test_command_line_interface.py +++ b/tests/test_command_line_interface.py @@ -337,8 +337,9 @@ def test_artifact_list(create_test_run: tuple[simvue.Run, dict]) -> None: "--mime-type", "--count=20", "--enumerate", - f"--format=simple" - ] + "--format=simple" + ], + catch_exceptions=False ) assert result.exit_code == 0, result.output assert run_data["file_1"] in result.output