From 7f7ab2e2c198a8f4cafbe63a9b7762407be83274 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Thu, 23 Nov 2023 00:37:25 +0100 Subject: [PATCH] CLI: Display output format choices within `crash --help` Previously, it was not easy to discover which value to supply to the `--format` command-line argument of `crash`. --- CHANGES.txt | 2 ++ crate/crash/command.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 77270a93..8724963c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -5,6 +5,8 @@ Changes for crash Unreleased ========== +- CLI: Added possible output format choices for ``--format`` argument to + ``crash --help``. Thanks, @mfussenegger. 2023/07/06 0.30.0 ================= diff --git a/crate/crash/command.py b/crate/crash/command.py index 7033fb61..0d6b6662 100644 --- a/crate/crash/command.py +++ b/crate/crash/command.py @@ -155,7 +155,8 @@ def _conf_or_default(key, value): parser.add_argument('--format', type=str, default=_conf_or_default('format', 'tabular'), choices=output_formats, metavar='FORMAT', - help='the output FORMAT of the SQL response') + help=f'the output FORMAT of the SQL response.\n' + f'choose one of: {", ".join(output_formats)}') parser.add_argument('--version', action='store_true', default=False, help='print the Crash version and exit')