Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/calendar Commit patch sent to tech-userlevel with un...



details:   https://anonhg.NetBSD.org/src/rev/de3870e92f61
branches:  trunk
changeset: 815778:de3870e92f61
user:      agc <agc%NetBSD.org@localhost>
date:      Fri Jun 03 02:06:40 2016 +0000

description:
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

diffstat:

 usr.bin/calendar/calendar.1 |  11 ++++++++---
 usr.bin/calendar/calendar.c |  11 ++++++++---
 2 files changed, 16 insertions(+), 6 deletions(-)

diffs (85 lines):

diff -r 2ab2a90ea9a5 -r de3870e92f61 usr.bin/calendar/calendar.1
--- a/usr.bin/calendar/calendar.1       Fri Jun 03 01:21:59 2016 +0000
+++ b/usr.bin/calendar/calendar.1       Fri Jun 03 02:06:40 2016 +0000
@@ -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 @@
 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
diff -r 2ab2a90ea9a5 -r de3870e92f61 usr.bin/calendar/calendar.c
--- a/usr.bin/calendar/calendar.c       Fri Jun 03 01:21:59 2016 +0000
+++ b/usr.bin/calendar/calendar.c       Fri Jun 03 02:06:40 2016 +0000
@@ -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 @@
 #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 @@
 
 #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;



Home | Main Index | Thread Index | Old Index