Re: [PATCH v2 08/35] built-ins: consistently add "\n" between "usage" and options
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Sep 28, 2022, 23:51 UTC
- Message-ID
- <CAPig+cRyyGnUa8sjy63=AMdqZ6vF_7nXnUwbAFvvjYYNDCB=FA@mail.gmail.com>
- In-Reply-To
- <patch-v2-08.35-4c68003904f-20220928T082458Z-avarab@gmail.com>
On Wed, Sep 28, 2022 at 4:42 AM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 10 quoted lines
> Change commands in the "diff" family and "rev-list" to separate the > usage information and option listing with an empty line. > > In the case of "git diff -h" we did this already (but let's use a > consistent "\n" pattern there), for the rest these are now consistent > with how the parse_options() API would emit usage. > > As we'll see in a subsequent commit this also helps to make the "git > <cmd> -h" output more easily machine-readable, as we can assume that > the usage usage information is separated from the options by an empty
s/usage usage/usage/
Show 12 quoted lines
> line. > > Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> > --- > "git diff-files [-q] [-0 | -1 | -2 | -3 | -c | --cc] [<common-diff-options>] [<path>...]" > +"\n" > COMMON_DIFF_OPTIONS_HELP; > > "git diff-tree [--stdin] [-m] [-c | --cc] [-s] [-v] [--pretty] [-t] [-r] [--root] " > "[<common-diff-options>] <tree-ish> [<tree-ish>] [<path>...]\n" > +"\n" > " -r diff recursively\n"
The patch itself was a confusing read until I realized that COMMON_DIFF_OPTIONS_HELP embeds its own "\n" as the first character.