Util-Linux package development
 help / color / mirror / Atom feed
From: Bruce Dubbs <bruce.dubbs@gmail.com>
To: util-linux@vger.kernel.org
Subject: Re: [PATCH] cal: drop trailing blank line
Date: Mon, 23 May 2016 18:32:52 -0500	[thread overview]
Message-ID: <57439324.90809@gmail.com> (raw)
In-Reply-To: <20160523225831.GQ26300@vapier.lan>

Mike Frysinger wrote:
> On 23 May 2016 16:30, Bruce Dubbs wrote:
>> Mike Frysinger wrote:
>>> There's no history to be found behind this, and the comment in the
>>> code indicates no one else knows, and it makes me angry :).
>>>
>>> --- a/misc-utils/cal.c
>>> +++ b/misc-utils/cal.c
>>> @@ -767,9 +767,6 @@ static void yearly(const struct cal_control *ctl)
>>>    		my_putstring("\n\n");
>>>    	}
>>>    	monthly(ctl);
>>> -
>>> -	/* Is empty line at the end year output really needed? */
>>> -	my_putstring("\n");
>>>    }
>>>
>>>    /*
>>
>> Personally I like the blank line. It sets off the cal output from the
>> shell prompt making it easier to read.  It is basically adding the
>> equivalent of the css property padding-bottom="1em".
>
> why should cal care ?  you could make this same exact argument for any
> other cli tool that displays things.  if you like that behavior, then
> update your PS1 to include a leading \n.

I certainly do not want to double space every bash prompt.  Your solution 
causes more problems than it solves.

>> I note that if doing a 'cal -y' that there is also a blank line between
>> the year and February.  That should stay also.
>
> that's a different issue.  cal always writes exactly 6 lines for a month
> regardless of how many weeks a month actually uses.  it makes the code
> simpler (no need to scan/remember sibling months) and the output more
> consistent -- every row is 7 lines.  pick a non-leap year like 2015 and
> see Feb take up only 4 lines but still leave 2 blank below it.  or pick
> 2019 and see Mar use all 6 lines.

Did you look at the output?

                                2016
---> blank line
        January               February                 March
Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa
                 1  2       1  2  3  4  5  6          1  2  3  4  5


   -- Bruce


  parent reply	other threads:[~2016-05-23 23:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-23 21:02 [PATCH] cal: drop trailing blank line Mike Frysinger
2016-05-23 21:30 ` Bruce Dubbs
2016-05-23 22:58   ` Mike Frysinger
2016-05-23 22:59     ` Mike Frysinger
2016-05-23 23:32     ` Bruce Dubbs [this message]
2016-05-24  1:02       ` Mike Frysinger
2018-01-25  4:22 ` Mike Frysinger
2018-01-25 11:26   ` J William Piggott

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57439324.90809@gmail.com \
    --to=bruce.dubbs@gmail.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox