git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cat-file: add missing [=<format>] to usage/synopsis
@ 2020-07-01 10:16 Christian Couder
  2020-07-01 15:03 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Couder @ 2020-07-01 10:16 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Christian Couder

When displaying cat-file usage, the fact that a <format> can
be specified is only visible when lookling at the --batch and
--batch-check options which are shown like this:

    --batch[=<format>]    show info and content of objects fed from the standard input
    --batch-check[=<format>]
                          show info about objects fed from the standard input

It seems more coherent and improves discovery to also show it
on the usage line.

In the documentation the DESCRIPTION tells us that "The output
format can be overridden using the optional <format> argument",
but we can't see the <format> argument in the SYNOPSIS above
the description which is confusing.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 Documentation/git-cat-file.txt | 2 +-
 builtin/cat-file.c             | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-cat-file.txt b/Documentation/git-cat-file.txt
index 8eca671b82..8e192d87db 100644
--- a/Documentation/git-cat-file.txt
+++ b/Documentation/git-cat-file.txt
@@ -10,7 +10,7 @@ SYNOPSIS
 --------
 [verse]
 'git cat-file' (-t [--allow-unknown-type]| -s [--allow-unknown-type]| -e | -p | <type> | --textconv | --filters ) [--path=<path>] <object>
-'git cat-file' (--batch | --batch-check) [ --textconv | --filters ] [--follow-symlinks]
+'git cat-file' (--batch[=<format>] | --batch-check[=<format>]) [ --textconv | --filters ] [--follow-symlinks]
 
 DESCRIPTION
 -----------
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index ae18e20a7c..5ebf13359e 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -596,7 +596,7 @@ static int batch_objects(struct batch_options *opt)
 
 static const char * const cat_file_usage[] = {
 	N_("git cat-file (-t [--allow-unknown-type] | -s [--allow-unknown-type] | -e | -p | <type> | --textconv | --filters) [--path=<path>] <object>"),
-	N_("git cat-file (--batch | --batch-check) [--follow-symlinks] [--textconv | --filters]"),
+	N_("git cat-file (--batch[=<format>] | --batch-check[=<format>]) [--follow-symlinks] [--textconv | --filters]"),
 	NULL
 };
 
-- 
2.27.0.221.ga08a83db2b.dirty


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cat-file: add missing [=<format>] to usage/synopsis
  2020-07-01 10:16 [PATCH] cat-file: add missing [=<format>] to usage/synopsis Christian Couder
@ 2020-07-01 15:03 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2020-07-01 15:03 UTC (permalink / raw)
  To: Christian Couder; +Cc: git, Junio C Hamano, Christian Couder

On Wed, Jul 01, 2020 at 12:16:18PM +0200, Christian Couder wrote:

> When displaying cat-file usage, the fact that a <format> can
> be specified is only visible when lookling at the --batch and
> --batch-check options which are shown like this:
> 
>     --batch[=<format>]    show info and content of objects fed from the standard input
>     --batch-check[=<format>]
>                           show info about objects fed from the standard input
> 
> It seems more coherent and improves discovery to also show it
> on the usage line.
> 
> In the documentation the DESCRIPTION tells us that "The output
> format can be overridden using the optional <format> argument",
> but we can't see the <format> argument in the SYNOPSIS above
> the description which is confusing.

Thanks, this makes sense and the patch looks good to me (it does make
the line very long, but the one above is much longer anyway).

-Peff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-01 15:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-01 10:16 [PATCH] cat-file: add missing [=<format>] to usage/synopsis Christian Couder
2020-07-01 15:03 ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).