diff options
author | Jason McIntyre <jmc@cvs.openbsd.org> | 2005-09-25 21:05:05 +0000 |
---|---|---|
committer | Jason McIntyre <jmc@cvs.openbsd.org> | 2005-09-25 21:05:05 +0000 |
commit | b39f9b52a5d038474664a377871f4312657dbef8 (patch) | |
tree | 9d0591c59563d30140040a31b0aa22401cd46492 /usr.bin | |
parent | 32d39117d55efd5f59740cb603ac1cb5972966f7 (diff) |
cal now (well, has done for a while) accepts a single argument
of the abbreviated month name: update SYNOPSIS, usage(), and
DESCRIPTION to reflect this;
remove a sentence that was repeated in the text - replace it with
something marginally more useful;
be clear that both numerical and string arguments are now accepted;
escape some hyphens whilst here;
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/cal/cal.1 | 23 | ||||
-rw-r--r-- | usr.bin/cal/cal.c | 6 |
2 files changed, 19 insertions, 10 deletions
diff --git a/usr.bin/cal/cal.1 b/usr.bin/cal/cal.1 index 17a3b788842..a197df7cc04 100644 --- a/usr.bin/cal/cal.1 +++ b/usr.bin/cal/cal.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: cal.1,v 1.12 2003/07/13 18:35:00 jmc Exp $ +.\" $OpenBSD: cal.1,v 1.13 2005/09/25 21:05:04 jmc Exp $ .\" $NetBSD: cal.1,v 1.6 1995/09/02 05:34:20 jtc Exp $ .\" .\" Copyright (c) 1989, 1990, 1993 @@ -43,14 +43,13 @@ .Nm cal .Op Fl jy .Oo -.Op Ar month +.Ar month .Ar year .Oc .Sh DESCRIPTION .Nm displays a simple calendar. -If arguments are not specified, -the current month is displayed. +Calendars may be displayed by month or by year. .Pp The options are as follows: .Bl -tag -width Ds @@ -60,13 +59,23 @@ Display Julian dates (days one-based, numbered from January 1). Display a calendar for the current year. .El .Pp -A single parameter specifies the year (1 - 9999) to be displayed; -note the year must be fully specified: +A single numerical parameter specifies the +.Ar year +(1 \- 9999) +to be displayed. +The year must be fully specified: .Dq Li cal 89 will .Em not display a calendar for 1989. -Two parameters denote the month (1 - 12) and year. +Two numerical parameters denote the +.Ar month +(1 \- 12) +and +.Ar year . +Alternatively, +a single parameter may be given specifying the abbreviated name of a month: +in that case a calendar is displayed for that month of the current year. If no parameters are specified, the current month's calendar is displayed. .Pp diff --git a/usr.bin/cal/cal.c b/usr.bin/cal/cal.c index e4edcededbb..428b9848df6 100644 --- a/usr.bin/cal/cal.c +++ b/usr.bin/cal/cal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cal.c,v 1.15 2005/08/24 05:19:41 deraadt Exp $ */ +/* $OpenBSD: cal.c,v 1.16 2005/09/25 21:05:04 jmc Exp $ */ /* $NetBSD: cal.c,v 1.6 1995/03/26 03:10:24 glass Exp $ */ /* @@ -40,7 +40,7 @@ static const char copyright[] = #if 0 static char sccsid[] = "@(#)cal.c 8.4 (Berkeley) 4/2/94"; #else -static const char rcsid[] = "$OpenBSD: cal.c,v 1.15 2005/08/24 05:19:41 deraadt Exp $"; +static const char rcsid[] = "$OpenBSD: cal.c,v 1.16 2005/09/25 21:05:04 jmc Exp $"; #endif #endif /* not lint */ @@ -422,7 +422,7 @@ void usage(void) { - (void)fprintf(stderr, "usage: cal [-jy] [[month] year]\n"); + (void)fprintf(stderr, "usage: cal [-jy] [month year]\n"); exit(1); } |