Re: [PATCH] usage_with_options: omit double new line on empty option list
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 25, 2017, 21:17 UTC
- Message-ID
- <xmqq4lsvs5y5.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CAGZ79kY6-R4Tt45BfnncH7tE46K8FG7RBDk+qb-tCU97CVQHvA@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
> Upon closer inspection, I have the impression that f389c808b6 > (Rework make_usage to print the usage message immediately, > 2007-10-14) introduced the extra new line without giving a rationale.
I do not think that is the case. The code before that patch collected all the usage strings in a strbuf sb, which had lines with their own terminating LFs, and then called usage() on sb.buf, which added an extra LF, so I think the commit was a faithful and bug-to-bug compatible rewrite.
But that does not matter in the bigger picture, as long as everybody agrees with the following:
Show 11 quoted lines
>> The other fputc('\n', outfile) that this version of the patch
>> touches is what I had trouble with, and I still do. There must be a
>> similar rationale like the previous one, i.e. "We have finished
>> giving the usage, and we have finished showing all the options. Now
>> we are about to further show X, so let's have a blank line here so
>> that what we have wrote will be separated from it", but I cannot
>> tell what that X is.
>
> Oh. I assumed that this X is the the next command in the users
> terminal, but I checked other commands and that is not the case
> at all (at least ls, vi, tar)Thanks.