summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2019-04-24 05:24:10 +0000
committerWarner Losh <imp@FreeBSD.org>2019-04-24 05:24:10 +0000
commit8b82def341087b6512496f05f3aa3ca0ebc9b5a8 (patch)
tree3888470744207ef4402cdb2b1138f165824f5735 /bin
parentb106e0fccc13639e28755b4acc1393c58312e2de (diff)
downloadsrc-test2-8b82def341087b6512496f05f3aa3ca0ebc9b5a8.tar.gz
src-test2-8b82def341087b6512496f05f3aa3ca0ebc9b5a8.zip
Restore the -n flag parsing, but ignore it.
Since D19668 was done, new users of the -n flag have surfaced. Parse and ignore it on the command line until they can be updated. Suggested by: rgrimes (in D19668).
Notes
Notes: svn path=/head/; revision=346624
Diffstat (limited to 'bin')
-rw-r--r--bin/date/date.16
-rw-r--r--bin/date/date.c4
2 files changed, 7 insertions, 3 deletions
diff --git a/bin/date/date.1 b/bin/date/date.1
index bfdb26adeaee..9943fb6669bc 100644
--- a/bin/date/date.1
+++ b/bin/date/date.1
@@ -32,7 +32,7 @@
.\" @(#)date.1 8.3 (Berkeley) 4/28/95
.\" $FreeBSD$
.\"
-.Dd March 20, 2019
+.Dd April 23, 2019
.Dt DATE 1
.Os
.Sh NAME
@@ -40,7 +40,7 @@
.Nd display or set date and time
.Sh SYNOPSIS
.Nm
-.Op Fl jRu
+.Op Fl jnRu
.Op Fl r Ar seconds | Ar filename
.Oo
.Fl v
@@ -142,6 +142,8 @@ This allows you to use the
flag in addition to the
.Cm +
option to convert one date format to another.
+.It Fl n
+Obsolete flag, accepted and ignored for compatibility.
.It Fl R
Use RFC 2822 date and time output format.
This is equivalent to using
diff --git a/bin/date/date.c b/bin/date/date.c
index 7f216e484740..cde299f6de61 100644
--- a/bin/date/date.c
+++ b/bin/date/date.c
@@ -108,7 +108,7 @@ main(int argc, char *argv[])
(void) setlocale(LC_TIME, "");
rflag = 0;
Iflag = jflag = Rflag = 0;
- while ((ch = getopt(argc, argv, "f:I::jRr:uv:")) != -1)
+ while ((ch = getopt(argc, argv, "f:I::jnRr:uv:")) != -1)
switch((char)ch) {
case 'f':
fmt = optarg;
@@ -132,6 +132,8 @@ main(int argc, char *argv[])
case 'j':
jflag = 1; /* don't set time */
break;
+ case 'n':
+ break;
case 'R': /* RFC 2822 datetime format */
if (Iflag)
multipleformats();