mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 06:18:47 +02:00
When you supply the date on the command-line, permit leaving out the year, which defaults to this year in that case.
This commit is contained in:
@@ -515,10 +515,12 @@ In other words, \fB\-i\fIvar\fR is exactly the same as \fB\-i\fIvar\fR\fB=\fR0.
|
|||||||
Allows you to define a function on the command line.
|
Allows you to define a function on the command line.
|
||||||
.PP
|
.PP
|
||||||
If you supply a \fIdate\fR on the command line, it must consist of
|
If you supply a \fIdate\fR on the command line, it must consist of
|
||||||
\fIday month year\fR, where \fIday\fR is the day of the month,
|
[\fIday\fR] \fImonth\fR [\fIyear\fR], where \fIday\fR is the day of the month,
|
||||||
\fImonth\fR is at least the first three letters of the English name
|
\fImonth\fR is at least the first three letters of the English name
|
||||||
of the month, and \fIyear\fR is a year (all 4 digits) from 1990 to
|
of the month, and \fIyear\fR is a year (all 4 digits) from 1990 to
|
||||||
about 2075. You can leave out the \fIday\fR, which then defaults to 1.
|
about 2075. You can leave out the \fIday\fR, which then defaults to 1.
|
||||||
|
If you leave out the year, then it defaults to the current year. You
|
||||||
|
cannot leave out the \fImonth\fR.
|
||||||
.PP
|
.PP
|
||||||
If you do supply a \fIdate\fR on the command line, then \fBRemind\fR
|
If you do supply a \fIdate\fR on the command line, then \fBRemind\fR
|
||||||
uses it, rather than the actual system date, as its notion of "today."
|
uses it, rather than the actual system date, as its notion of "today."
|
||||||
|
|||||||
15
src/init.c
15
src/init.c
@@ -806,16 +806,13 @@ void InitRemind(int argc, char const *argv[])
|
|||||||
if (dse != NO_DATE) {
|
if (dse != NO_DATE) {
|
||||||
FromDSE(dse, &y, &m, &d);
|
FromDSE(dse, &y, &m, &d);
|
||||||
}
|
}
|
||||||
/* Must supply date in the form: day, mon, yr OR mon, yr */
|
/* Must supply date in the form: day, mon, yr OR mon, yr */
|
||||||
if (m != NO_MON || y != NO_YR || d != NO_DAY) {
|
if (m != NO_MON || y != NO_YR || d != NO_DAY) {
|
||||||
if (m == NO_MON || y == NO_YR) {
|
if (y == NO_YR) {
|
||||||
if (rep == NO_REP) Usage();
|
y = CurYear;
|
||||||
else if (m != NO_MON || y != NO_YR) Usage();
|
}
|
||||||
else {
|
if (m == NO_MON) {
|
||||||
m = CurMon;
|
Usage();
|
||||||
y = CurYear;
|
|
||||||
if (d == NO_DAY) d = CurDay;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (d == NO_DAY) d=1;
|
if (d == NO_DAY) d=1;
|
||||||
if (d > DaysInMonth(m, y)) {
|
if (d > DaysInMonth(m, y)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user