Module Name: src
Committed By: agc
Date: Fri Jun 3 02:06:40 UTC 2016
Modified Files:
src/usr.bin/calendar: calendar.1 calendar.c
Log Message:
Commit patch sent to tech-userlevel with universal approval to add a
version option for calendar(1):
% calendar -v
calendar-20160601
%
For reference, see:
http://mail-index.netbsd.org/tech-userlevel/2016/06/02/msg010081.html
To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.bin/calendar/calendar.1
cvs rdiff -u -r1.52 -r1.53 src/usr.bin/calendar/calendar.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/calendar/calendar.1
diff -u src/usr.bin/calendar/calendar.1:1.25 src/usr.bin/calendar/calendar.1:1.26
--- src/usr.bin/calendar/calendar.1:1.25 Tue Jun 8 03:08:47 2010
+++ src/usr.bin/calendar/calendar.1 Fri Jun 3 02:06:40 2016
@@ -1,4 +1,4 @@
-.\" $NetBSD: calendar.1,v 1.25 2010/06/08 03:08:47 riz Exp $
+.\" $NetBSD: calendar.1,v 1.26 2016/06/03 02:06:40 agc Exp $
.\"
.\" Copyright (c) 1989, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" @(#)calendar.1 8.1 (Berkeley) 6/29/93
.\"
-.Dd August 27, 2009
+.Dd June 1, 2016
.Dt CALENDAR 1
.Os
.Sh NAME
@@ -37,7 +37,7 @@
.Nd reminder service
.Sh SYNOPSIS
.Nm
-.Op Fl ax
+.Op Fl avx
.Op Fl d Ar MMDD[[YY]YY]
.Op Fl f Ar file
.Op Fl l Ar days
@@ -95,6 +95,11 @@ number if and only if the day specified
The default value is two, which causes
.Nm
to print entries through the weekend on Fridays.
+.It Fl v
+Causes
+.Nm
+to print version information for itself,
+and then exit.
.It Fl x
Causes
.Nm
Index: src/usr.bin/calendar/calendar.c
diff -u src/usr.bin/calendar/calendar.c:1.52 src/usr.bin/calendar/calendar.c:1.53
--- src/usr.bin/calendar/calendar.c:1.52 Wed Jul 1 06:48:25 2015
+++ src/usr.bin/calendar/calendar.c Fri Jun 3 02:06:40 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: calendar.c,v 1.52 2015/07/01 06:48:25 dholland Exp $ */
+/* $NetBSD: calendar.c,v 1.53 2016/06/03 02:06:40 agc Exp $ */
/*
* Copyright (c) 1989, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19
#if 0
static char sccsid[] = "@(#)calendar.c 8.4 (Berkeley) 1/7/95";
#endif
-__RCSID("$NetBSD: calendar.c,v 1.52 2015/07/01 06:48:25 dholland Exp $");
+__RCSID("$NetBSD: calendar.c,v 1.53 2016/06/03 02:06:40 agc Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -65,6 +65,8 @@ __RCSID("$NetBSD: calendar.c,v 1.52 2015
#include "pathnames.h"
+#define CALENDAR_VERSION "calendar-20160601"
+
/* flags used by calendar file parser */
#define F_ISMONTH 0x01
#define F_ISDAY 0x02
@@ -133,7 +135,7 @@ main(int argc, char **argv)
(void)setprogname(argv[0]); /* for portability */
- while ((ch = getopt(argc, argv, "-ad:f:l:w:x")) != -1) {
+ while ((ch = getopt(argc, argv, "-ad:f:l:vw:x")) != -1) {
switch (ch) {
case '-': /* backward contemptible */
case 'a':
@@ -152,6 +154,9 @@ main(int argc, char **argv)
case 'l':
atodays(ch, optarg, &lookahead);
break;
+ case 'v':
+ printf("%s\n", CALENDAR_VERSION);
+ return 0;
case 'w':
atodays(ch, optarg, &weekend);
break;