From 53557043776486f66c24a648192c265cb597175e Mon Sep 17 00:00:00 2001 From: Jonathan Giffard <39745127+LackOfMorals@users.noreply.github.com> Date: Tue, 19 Sep 2023 11:27:51 +0100 Subject: [PATCH] Added .lower() at end of output_format If a CLI user uses a capital letter in the output format option, it triggers an exception as it's not recognised As there's no functionality impact from a user doing this, and it could be common e.g using Json instead of json, then changing output_format to be lower case for the comparison is a quick win for an improved user experience. --- aura/api_command.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aura/api_command.py b/aura/api_command.py index 7c8e8cb..4916a37 100644 --- a/aura/api_command.py +++ b/aura/api_command.py @@ -79,15 +79,15 @@ def wrapper(output: str, include: bool, raw: bool, verbose: bool, *args, **kwarg if data is None: print("Operation successful") - elif output_format == "json": + elif output_format.lower() == "json": print(json.dumps(data, indent=2)) - elif output_format == "table": + elif output_format.lower() == "table": out = format_table_output(data) print(out) - elif output_format == "text": + elif output_format.lower() == "text": out = format_text_output(data) print(out) - elif output_format == "yaml": + elif output_format.lower() == "yaml": print(yaml.dump(data)) else: raise UnsupportedOutputFormat(output_format)