Skip to content

Commit

Permalink
CLI: Display output format choices within crash --help
Browse files Browse the repository at this point in the history
Previously, it was not easy to discover which value to supply to the
`--format` command-line argument of `crash`.
  • Loading branch information
amotl committed Nov 23, 2023
1 parent 0c80dfc commit 7f7ab2e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
=================
Expand Down
3 changes: 2 additions & 1 deletion crate/crash/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down

0 comments on commit 7f7ab2e

Please sign in to comment.