On Fri, May 03, 2024 at 08:38:27PM +0200, Michael Meskes wrote:
> > I think that ship has sailed already, since e.g. -m in the ncal
> > version
> > specifies the month (a bit superfluously), whereas in the util-linux
> > version it
> > sets the beginning of the week to Monday.
> 
> Not sure why specifying the month is superfluous.
>

I'm sorry, that was a bit tongue in cheek. I'm sure there are valid uses for
this, but since cal can take the month as first argument, when given two
numeric arguments, there are multiple ways of achieving the same goal.

> > An alternative I could see would be to drop cal from the ncal package
> > and only
> > provide cal from util-linux.
> > 
> > Nothing would be lost, since ncal can act as cal with the -C option,
> > so users
> > wanting that specific cal could use a function
> > 
> >     cal() {
> >         ncal -C $@
> >     }
> > 
> > and the rest would get a cal that can show week numbers and set the
> > beginning of
> > the Monday.
> 
> Now I'm confused. Is the reason for this proposal to have a cal that
> shows week numbers and forces the start of the week to Monday? Well,
> ncal does both of this, so why don't you just use something like "ncal
> -wMb" as cal? Not that ncal needs "-M", it is able to get this from
> your locale.
> 

The example was to show how people could achieve using ncal to get cal, if the
ncal package would not ship a cal binary.

This is *not* about forcing Monday, util-linux cal takes that from the locale as
well, but when working in mixed locale settings or on a machine with just
C.UTF-8, it is nice to be able to change it and the obvious "cal -M" fails for
the ncal version, as does "cal -w". Requiring the use of ncal (instead of cal)
and an option documented as "Use oldstyle format for ncal output" seems highly
non-obvious to me.

> The question is does it offer all the other features? Or would we be
> better of switching to something like gcal instead?

That depends on what all the necessary features are? The differences as far as I
can see them at this moment are

- util-linux cal doesn't provide the date of Easter, unlike ncal cal
- util-linux cal supports beginning of week and week number switches for cal,
  which do not work with ncal cal
- util-linux cal supports years after 9999
- util-linux cal supports month names as strings instead of the -m argument
- ncal cal has -B and -A arguments for before and after, util-linux cal has a
  --months (-n) switch for the number of months and they can be cented around a
  given month with the --span (-S) option

gcal supports more different calendars and more holidays, but this seems to go
beyond the basic calendar functionality of either util-linux' and ncal's
implementation.

Attachment: signature.asc
Description: PGP signature

Reply via email to