summaryrefslogtreecommitdiffstats
path: root/usr.bin/calendar/calendar.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/calendar/calendar.c')
-rw-r--r--usr.bin/calendar/calendar.c43
1 files changed, 23 insertions, 20 deletions
diff --git a/usr.bin/calendar/calendar.c b/usr.bin/calendar/calendar.c
index 29ac174..bd03e02 100644
--- a/usr.bin/calendar/calendar.c
+++ b/usr.bin/calendar/calendar.c
@@ -35,7 +35,7 @@ static const char copyright[] =
#if 0
#ifndef lint
-static char sccsid[] = "@(#)calendar.c 8.3 (Berkeley) 3/25/94";
+static char sccsid[] = "@(#)calendar.c 8.3 (Berkeley) 3/25/94";
#endif
#endif
@@ -79,7 +79,7 @@ main(int argc, char *argv[])
(void)setlocale(LC_ALL, "");
- while ((ch = getopt(argc, argv, "-A:aB:dD:F:f:l:t:U:W:")) != -1)
+ while ((ch = getopt(argc, argv, "-A:aB:D:dF:f:l:t:U:W:?")) != -1)
switch (ch) {
case '-': /* backward contemptible */
case 'a':
@@ -90,10 +90,6 @@ main(int argc, char *argv[])
doall = 1;
break;
- case 'f': /* other calendar file */
- calendarFile = optarg;
- break;
-
case 'W': /* we don't need no steenking Fridays */
Friday = -1;
/* FALLTHROUGH */
@@ -106,26 +102,34 @@ main(int argc, char *argv[])
f_dayBefore = atoi(optarg);
break;
+ case 'D': /* debug output of sun and moon info */
+ DEBUG = optarg;
+ break;
+
+ case 'd': /* debug output of current date */
+ debug = 1;
+ break;
+
case 'F': /* Change the time: When does weekend start? */
Friday = atoi(optarg);
break;
+
+ case 'f': /* other calendar file */
+ calendarFile = optarg;
+ break;
+
case 'l': /* Change longitudal position */
EastLongitude = strtol(optarg, NULL, 10);
break;
- case 'U': /* Change UTC offset */
- UTCOffset = strtod(optarg, NULL);
- break;
- case 'd':
- debug = 1;
- break;
- case 'D':
- DEBUG = optarg;
- break;
- case 't': /* other date, undocumented, for tests */
+ case 't': /* other date, for tests */
f_time = Mktime(optarg);
break;
+ case 'U': /* Change UTC offset */
+ UTCOffset = strtod(optarg, NULL);
+ break;
+
case '?':
default:
usage();
@@ -216,10 +220,9 @@ usage(void)
{
fprintf(stderr, "%s\n%s\n%s\n",
- "usage: calendar [-a] [-A days] [-B days] [-F friday] "
- "[-f calendarfile]",
- " [-d] [-t dd[.mm[.year]]] [-W days]",
- " [-U utcoffset] [-l longitude]"
+ "usage: calendar [-A days] [-a] [-B days] [-D sun|moon] [-d]",
+ " [-F friday] [-f calendarfile] [-l longitude]",
+ " [-t dd[.mm[.year]]] [-U utcoffset] [-W days]"
);
exit(1);
}
OpenPOWER on IntegriCloud