parse-options API users: align usage output in C-strings
commit5d70198efedcbb2bf626a5d007d8080cd342cb6e
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Mon, 13 Sep 2021 00:13:19 +0000 (13 02:13 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 13 Sep 2021 01:57:30 +0000 (12 18:57 -0700)
treebc14730129d6f8045068750dc7de7ad413a490ad
parent8b7c11b8668b4e774f81a9f0b4c30144b818f1d1
parse-options API users: align usage output in C-strings

In preparation for having continued usage lines properly aligned in
"git <cmd> -h" output, let's have the "[" on the second such lines
align with the "[" on the first line.

In some cases this makes the output worse, because e.g. the "git
ls-remote -h" output had been aligned to account for the extra
whitespace that the usage_with_options_internal() function in
parse-options.c would add.

In other cases such as builtin/stash.c (not changed here), we were
aligned in the C strings, but since that didn't account for the extra
padding in usage_with_options_internal() it would come out looking
misaligned, e.g. code like this:

N_("git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]\n"
   "          [-u|--include-untracked] [-a|--all] [-m|--message <message>]\n"

Would emit:

   or: git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]
          [-u|--include-untracked] [-a|--all] [-m|--message <message>]

Let's change all the usage arrays which use such continued usage
output via "\n"-embedding to be like builtin/stash.c.

This makes the output worse temporarily, but in a subsequent change
I'll improve the usage_with_options_internal() to take this into
account, at which point all of the strings being changed here will
emit prettier output.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/ls-remote.c
builtin/show-branch.c
builtin/stash.c
builtin/tag.c