summaryrefslogtreecommitdiffstats
path: root/bin/date/date.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-08-09 22:34:06 +0000
committerbrian <brian@FreeBSD.org>1997-08-09 22:34:06 +0000
commit4f0afc74e17ee11803bc5cd677cd5c1069e1e2af (patch)
tree21e19f0d4b80b5e252a80d01ca6e6739a600de48 /bin/date/date.c
parentc207fc1e7a02a971955590cdbd2099c27b920653 (diff)
downloadFreeBSD-src-4f0afc74e17ee11803bc5cd677cd5c1069e1e2af.zip
FreeBSD-src-4f0afc74e17ee11803bc5cd677cd5c1069e1e2af.tar.gz
Change [-DMHW [+|-]val] to [-v [+|-]val[ymwdHM]]
Support Hours & Minutes Add -Wall to Makefile
Diffstat (limited to 'bin/date/date.c')
-rw-r--r--bin/date/date.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/bin/date/date.c b/bin/date/date.c
index ad9ffca..c6e6d517 100644
--- a/bin/date/date.c
+++ b/bin/date/date.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: date.c,v 1.13 1997/06/06 06:34:37 charnier Exp $
+ * $Id: date.c,v 1.14 1997/08/04 03:37:06 brian Exp $
*/
#ifndef lint
@@ -89,7 +89,7 @@ main(argc, argv)
tz.tz_dsttime = tz.tz_minuteswest = 0;
rflag = 0;
set_timezone = 0;
- while ((ch = getopt(argc, argv, "D:W:M:Y:d:nr:ut:")) != -1)
+ while ((ch = getopt(argc, argv, "d:nr:ut:v:")) != -1)
switch((char)ch) {
case 'd': /* daylight savings time */
tz.tz_dsttime = strtol(optarg, &endptr, 10) ? 1 : 0;
@@ -114,11 +114,8 @@ main(argc, argv)
usage();
set_timezone = 1;
break;
- case 'D':
- case 'W':
- case 'M':
- case 'Y':
- v = vary_append(v, ch, optarg);
+ case 'v':
+ v = vary_append(v, optarg);
break;
default:
usage();
@@ -155,8 +152,8 @@ main(argc, argv)
lt = *localtime(&tval);
badv = vary_apply(v, &lt);
if (badv) {
- fprintf(stderr, "-%c %s: Cannot apply date adjustment\n",
- badv->flag, badv->arg);
+ fprintf(stderr, "%s: Cannot apply date adjustment\n",
+ badv->arg);
vary_destroy(v);
usage();
}
@@ -258,7 +255,7 @@ static void
usage()
{
(void)fprintf(stderr, "%s\n%s\n",
- "usage: date [-nu] [-d dst] [-r seconds] [-t west] [+format]",
- " [-DWMY [+|-]val] [[[[yy]mm]dd]HH]MM[.ss]]");
+ "usage: date [-nu] [-d dst] [-r seconds] [-t west] [+format]",
+ " [-v [+|-]val[ymwdHM]]... [[[[yy]mm]dd]HH]MM[.ss]]");
exit(1);
}
OpenPOWER on IntegriCloud