Index | Thread | Search

From:
Jeremie Courreges-Anglas <jca@wxcvbn.org>
Subject:
Re: cal's -y flag usage
To:
Johannes Thyssen Tishman <jtt@openbsd.org>, tech@openbsd.org
Date:
Fri, 26 Jun 2026 16:42:03 +0200

Download raw body.

Thread
On Fri, Jun 26, 2026 at 12:40:23PM +0000, Johannes Thyssen Tishman wrote:
> 2026-06-25T21:47:47+0200 Jeremie Courreges-Anglas <jca@wxcvbn.org>:
> > On Thu, Jun 25, 2026 at 09:13:44AM +0000, Johannes Thyssen Tishman wrote:
> > > While playing with cal I noticed that using the -y flag along with a
> > > single non-numerical argument or with two arguments would essentially
> > > cause the option to be ignored:
> > > 
> > > $ cal -y jun
> > > $ cal -y jun 2026
> > > $ cal -y 06 2026
> > > 
> > > All three commands output the calendar for June 2026 instead of the
> > > entire year. Before I try to patch this, is this the desired/intended
> > > behaviour?
> > 
> > IMO -y should be ignored when a year is later specified on the command
> > line (current behavior), and should conflict with specifying a month.
> 
> So, like this (diff below)?
> 
> $ cal -y          # calendar for year 2026
> $ cal -y 2000     # calendar for year 2000
> $ cal -y jul      # error
> $ cal -y jul 2000 # error

Yup!

-- 
jca