This series of patches to cat-file significantly improves the UX of the -h output, see 08/10. For the v4 see[1], for the new usage output see [2]. This re-roll addresses a minor s/_/-/ in option name typo out by John Cai in his review of the series. 1. https://lore.kernel.org/git/cover-v4-00.10-00000000000-20211208T123151Z-avarab@xxxxxxxxx/ 2. https://lore.kernel.org/git/patch-v5-08.10-16b6bb8aaf2-20211222T041050Z-avarab@xxxxxxxxx/ Æ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: use GET_OID_ONLY_TO_DIE in --(textconv|filters) Documentation/git-cat-file.txt | 10 +- builtin/cat-file.c | 182 ++++++++++++++++++++------------- builtin/stash.c | 4 +- cache.h | 1 + object-name.c | 8 +- parse-options.c | 13 +++ parse-options.h | 10 ++ t/t1006-cat-file.sh | 92 +++++++++++++++++ t/t8007-cat-file-textconv.sh | 42 ++++++++ 9 files changed, 282 insertions(+), 80 deletions(-) Range-diff against v4: 1: b3d8ec1697f = 1: e771bd38792 cat-file tests: test bad usage 2: eb6fa584287 = 2: 291312e2fb5 cat-file tests: test messaging on bad objects/paths 3: 01de6e4305f = 3: 0689dbb248c parse-options API: add a usage_msg_optf() 4: aa384803fef = 4: 2a28b39430e cat-file docs: fix SYNOPSIS and "-h" output 5: 32365ff569b = 5: 2d90c12fe7b cat-file: move "usage" variable to cmd_cat_file() 6: 473ea3b0394 = 6: 227805d1804 cat-file: make --batch-all-objects a CMDMODE 7: 878d9052bfb ! 7: e6ea403efe0 cat-file: fix remaining usage bugs @@ builtin/cat-file.c: int cmd_cat_file(int argc, const char **argv, const char *pr + "--buffer"); + else if (batch.all_objects) + usage_msg_optf(_("'%s' requires a batch mode"), usage, options, -+ "--batch-all_objects"); ++ "--batch-all-objects"); + + /* Batch defaults */ if (batch.buffer_output < 0) 8: ebc8dd0a22e = 8: 16b6bb8aaf2 cat-file: correct and improve usage information 9: a7447510e4b = 9: 47543c57135 object-name.c: don't have GET_OID_ONLY_TO_DIE imply *_QUIETLY 10: a658099e3e1 = 10: 63920969ca8 cat-file: use GET_OID_ONLY_TO_DIE in --(textconv|filters) -- 2.34.1.1146.gb52885e7c44