]> git.ipfire.org Git - thirdparty/git.git/commit
parse-options: drop leading space from '--git-completion-helper' output
authorSZEDER Gábor <szeder.dev@gmail.com>
Fri, 19 Aug 2022 16:03:59 +0000 (18:03 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Aug 2022 18:13:14 +0000 (11:13 -0700)
commitdc9f98832b849ee05b84bad1a55f5e04b82d0520
treead455c8785f829db8cfd2038657d7783cf72f129
parenta9126b92a2adddb58522a342cdbaf0aec4d879bf
parse-options: drop leading space from '--git-completion-helper' output

The output of 'git <cmd> --git-completion-helper' always starts with a
space, e.g.:

  $ git config --git-completion-helper
   --global --system --local [...]

This doesn't matter for the completion script, because field splitting
discards that space anyway.

However, later patches in this series will teach parse-options to
handle subcommands, and subcommands will be included in the completion
helper output as well.  This will make the loop printing options (and
subcommands) a tad more complex, so I wanted to test the result.  The
test would have to account for the presence of that leading space,
which bugged my OCD, so let's get rid of it.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
parse-options.c