Re: [PATCH] cal: drop trailing blank line

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 23 May 2016 18:32, Bruce Dubbs wrote:
> 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.

if you want to special case `cal` or any other util, then alias it in
your shell.  your personal preference for a util doesn't mean it should
stay that way.  the trailing newline is uncommon in the cli world.

> >> 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?

i thought you were talking about the inter-month spacing.  i don't care
about either of those, nor does my change impact them.
-mike

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux