Index: calendar.1 =================================================================== RCS file: /cvsroot/src/usr.bin/calendar/calendar.1,v retrieving revision 1.25 diff -u -r1.25 calendar.1 --- calendar.1 8 Jun 2010 03:08:47 -0000 1.25 +++ calendar.1 1 Jun 2016 20:40:40 -0000 @@ -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 @@ 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: calendar.c =================================================================== RCS file: /cvsroot/src/usr.bin/calendar/calendar.c,v retrieving revision 1.52 diff -u -r1.52 calendar.c --- calendar.c 1 Jul 2015 06:48:25 -0000 1.52 +++ calendar.c 1 Jun 2016 20:40:40 -0000 @@ -65,6 +65,8 @@ #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 @@ (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 @@ case 'l': atodays(ch, optarg, &lookahead); break; + case 'v': + printf("%s\n", CALENDAR_VERSION); + return 0; case 'w': atodays(ch, optarg, &weekend); break;