Subject: Re: silly request for ideas about about silly change
To: None <tech-userlevel@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-userlevel
Date: 06/21/2002 22:24:07
> >
> > > I can't figure out a decent letter to use for the
> > > "show three months" switch.
> >
> > Why does it have to be a letter? "cal -3" seems appropriate to me.
>
> I thought so too (and I also want this option), but wouldn't the user
> then assume that she can do "cal -N"? Not that that would necessarily
> be a bad thing...
cal -[123456789] would be ok
OTOH
months = 0;
while ((c == getopt(c,v,"0123456789")) != -1) do
if (isdigit(c)) {
months = months * 10 + c - '0';
continue;
}
...
}
if (!months) months=1;
might be deemed to be streching the posix rules for getopt a little!
Might be better to think of 2 letters, one for the 'months ago'
to start, the second for the 'number of months'.
Could also be worth getting the terminal width.
cal -jy is 51 lines, but would only be just over 80 cols at
3 months per line.....
(ok I was playing with a window that was 2000+ columns wide
earlier...)
David
--
David Laight: david@l8s.co.uk