git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 3/3] parse-options: only insert newline in help text if needed

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 25, 2017, 05:39 UTC
Message-ID
<xmqqing7e3qs.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1506312485-8370-3-git-send-email-drafnel@gmail.com>
Brandon Casey <drafnel@gmail.com> writes:
Show 7 quoted lines
> Currently, when parse_options() produces a help message it always emits
> a blank line after the usage text to separate it from the options text.
> If the option spec does not define any switches, or only defines hidden
> switches that will not be displayed, then the help text will end up with
> two trailing blank lines instead of one.  Let's defer emitting the blank
> line between the usage text and the options text until it is clear that
> the options section will not be empty.

This somehow looks familiar. I think (together with the fix in 2/3) this makes it definitely better.

I also wonder if we want the final blank line, but that is sort-of a different issue.

Thanks.
Previous: Brandon CaseyNext: Junio C Hamano
Message 3 of 5 in “t0040,t1502: Demonstrate parse_options bugs”
  1. 1/3 t0040,t1502: Demonstrate parse_options bugsBrandon Casey, Sep 25, 2017
  2. 3/3 parse-options: only insert newline in help text if neededBrandon Casey, Sep 25, 2017
  3. Junio C HamanoSep 25, 2017
  4. Junio C HamanoSep 25, 2017
  5. 2/3 parse-options: write blank line to correct output streamBrandon Casey, Sep 25, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.