This series of patches to cat-file significantly improves the UX of the -h output, see 08/10. This is something I hacked up a month or so ago but didn't send after the discussion thread about whether --batch-all-objects should be a cmdmode[1]. This series marks it as such, as the square peg of wanting to have mutually exclusive options best fits into the "cmdmode" round hole in parse-options.c :) I'm submitting this now because John Cai has a proposed change to cat-file[2] which I proposed an alternate direction to on top of this series. I think as should become clear when reading this series a careful look at any change to cat-file's interface would come up against the missing assertions of what options are compatible with what other options etc., which is hopefully all fixed and tested for in this series. 1. https://lore.kernel.org/git/87tuhuikhf.fsf@xxxxxxxxxxxxxxxxxxx/ 2. https://lore.kernel.org/git/pull.1124.git.git.1636149400.gitgitgadget@xxxxxxxxx/#t Ævar Arnfjörð Bjarmason (10): cat-file tests: test bad usage cat-file tests: test messaging on bad objects/paths parse-options API: add a usage_msg_optf() cat-file docs: fix SYNOPSIS and "-h" output cat-file: move "usage" variable to cmd_cat_file() cat-file: make --batch-all-objects a CMDMODE cat-file: fix remaining usage bugs cat-file: correct and improve usage information object-name.c: don't have GET_OID_ONLY_TO_DIE imply *_QUIETLY cat-file: improve --(textconv|filters) disambiguation Documentation/git-cat-file.txt | 10 +- builtin/cat-file.c | 181 ++++++++++++++++++++------------- builtin/stash.c | 4 +- cache.h | 1 + object-name.c | 11 +- parse-options.c | 13 +++ parse-options.h | 10 ++ t/t1006-cat-file.sh | 88 ++++++++++++++++ t/t8007-cat-file-textconv.sh | 26 +++++ 9 files changed, 263 insertions(+), 81 deletions(-) -- 2.34.0.rc1.741.gab7bfd97031