mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 14:28:40 +02:00
Compare commits
40 Commits
06.00.00-B
...
06.00.02
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0416d6da9c | ||
|
|
5d46df871f | ||
|
|
c5d661124c | ||
|
|
2f239f77a5 | ||
|
|
1ef05d3f85 | ||
|
|
7c56aad791 | ||
|
|
5f0f68f508 | ||
|
|
71bfe31002 | ||
|
|
4661b454c0 | ||
|
|
d41520a04f | ||
|
|
0206e538e0 | ||
|
|
6689cbfda3 | ||
|
|
5baf102bfe | ||
|
|
c9002d5b54 | ||
|
|
ac3ee7e22b | ||
|
|
f366037b8d | ||
|
|
a46488a50d | ||
|
|
f91a1a2d65 | ||
|
|
2ac8fb50e1 | ||
|
|
7df826f635 | ||
|
|
f8ce7b51da | ||
|
|
35ee94ca6b | ||
|
|
c2a3468e04 | ||
|
|
4ff2064452 | ||
|
|
8e00bd5acc | ||
|
|
86f65e11bb | ||
|
|
0c9ec11fce | ||
|
|
07dcaec176 | ||
|
|
e87849256b | ||
|
|
fd8ecd88a8 | ||
|
|
5e36a6563a | ||
|
|
274a2bf067 | ||
|
|
4aa737e542 | ||
|
|
6474f4e0b6 | ||
|
|
7b7b861399 | ||
|
|
5cb0e82be2 | ||
|
|
d9a4bd19f2 | ||
|
|
1004946d26 | ||
|
|
d877a6cb48 | ||
|
|
3eea329b32 |
79
configure
vendored
79
configure
vendored
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.72 for remind 06.00.00.
|
||||
# Generated by GNU Autoconf 2.72 for remind 06.00.02.
|
||||
#
|
||||
#
|
||||
# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation,
|
||||
@@ -601,8 +601,8 @@ MAKEFLAGS=
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='remind'
|
||||
PACKAGE_TARNAME='remind'
|
||||
PACKAGE_VERSION='06.00.00'
|
||||
PACKAGE_STRING='remind 06.00.00'
|
||||
PACKAGE_VERSION='06.00.02'
|
||||
PACKAGE_STRING='remind 06.00.02'
|
||||
PACKAGE_BUGREPORT=''
|
||||
PACKAGE_URL='https://dianne.skoll.ca/projects/remind/'
|
||||
|
||||
@@ -1258,7 +1258,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
'configure' configures remind 06.00.00 to adapt to many kinds of systems.
|
||||
'configure' configures remind 06.00.02 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1320,7 +1320,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of remind 06.00.00:";;
|
||||
short | recursive ) echo "Configuration of remind 06.00.02:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1408,7 +1408,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
remind configure 06.00.00
|
||||
remind configure 06.00.02
|
||||
generated by GNU Autoconf 2.72
|
||||
|
||||
Copyright (C) 2023 Free Software Foundation, Inc.
|
||||
@@ -1871,7 +1871,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by remind $as_me 06.00.00, which was
|
||||
It was created by remind $as_me 06.00.02, which was
|
||||
generated by GNU Autoconf 2.72. Invocation command line was
|
||||
|
||||
$ $0$ac_configure_args_raw
|
||||
@@ -2477,6 +2477,8 @@ as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H"
|
||||
as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H"
|
||||
as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H"
|
||||
as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H"
|
||||
as_fn_append ac_header_c_list " readline/readline.h readline_readline_h HAVE_READLINE_READLINE_H"
|
||||
as_fn_append ac_header_c_list " readline/history.h readline_history_h HAVE_READLINE_HISTORY_H"
|
||||
|
||||
# Auxiliary files required by this configure script.
|
||||
ac_aux_files="install-sh"
|
||||
@@ -3941,6 +3943,57 @@ then :
|
||||
|
||||
fi
|
||||
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5
|
||||
printf %s "checking for readline in -lreadline... " >&6; }
|
||||
if test ${ac_cv_lib_readline_readline+y}
|
||||
then :
|
||||
printf %s "(cached) " >&6
|
||||
else case e in #(
|
||||
e) ac_check_lib_save_LIBS=$LIBS
|
||||
LIBS="-lreadline $LIBS"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
/* Override any GCC internal prototype to avoid an error.
|
||||
Use char because int might match the return type of a GCC
|
||||
builtin and then its argument prototype would still apply.
|
||||
The 'extern "C"' is for builds by C++ compilers;
|
||||
although this is not generally supported in C code supporting it here
|
||||
has little cost and some practical benefit (sr 110532). */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
char readline (void);
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
return readline ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"
|
||||
then :
|
||||
ac_cv_lib_readline_readline=yes
|
||||
else case e in #(
|
||||
e) ac_cv_lib_readline_readline=no ;;
|
||||
esac
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.beam \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LIBS=$ac_check_lib_save_LIBS ;;
|
||||
esac
|
||||
fi
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5
|
||||
printf "%s\n" "$ac_cv_lib_readline_readline" >&6; }
|
||||
if test "x$ac_cv_lib_readline_readline" = xyes
|
||||
then :
|
||||
printf "%s\n" "#define HAVE_LIBREADLINE 1" >>confdefs.h
|
||||
|
||||
LIBS="-lreadline $LIBS"
|
||||
|
||||
fi
|
||||
|
||||
ac_header= ac_cache=
|
||||
for ac_item in $ac_header_c_list
|
||||
do
|
||||
@@ -3973,6 +4026,8 @@ fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# The cast to long int works around a bug in the HP C Compiler
|
||||
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
|
||||
# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'.
|
||||
@@ -4270,6 +4325,12 @@ then :
|
||||
printf "%s\n" "#define HAVE_INOTIFY_INIT1 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
ac_fn_c_check_func "$LINENO" "readline" "ac_cv_func_readline"
|
||||
if test "x$ac_cv_func_readline" = xyes
|
||||
then :
|
||||
printf "%s\n" "#define HAVE_READLINE 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
|
||||
VERSION=$PACKAGE_VERSION
|
||||
@@ -4787,7 +4848,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by remind $as_me 06.00.00, which was
|
||||
This file was extended by remind $as_me 06.00.02, which was
|
||||
generated by GNU Autoconf 2.72. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -4852,7 +4913,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config='$ac_cs_config_escaped'
|
||||
ac_cs_version="\\
|
||||
remind config.status 06.00.00
|
||||
remind config.status 06.00.02
|
||||
configured by $0, generated by GNU Autoconf 2.72,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_INIT(remind, 06.00.00, , , https://dianne.skoll.ca/projects/remind/)
|
||||
AC_INIT(remind, 06.00.02, , , https://dianne.skoll.ca/projects/remind/)
|
||||
AC_CONFIG_SRCDIR([src/queue.c])
|
||||
|
||||
cat <<'EOF'
|
||||
@@ -30,7 +30,8 @@ AC_PATH_PROG([PERL], [perl])
|
||||
|
||||
dnl Checks for libraries.
|
||||
AC_CHECK_LIB(m, sqrt)
|
||||
AC_CHECK_HEADERS_ONCE([sys/time.h stdint.h])
|
||||
AC_CHECK_LIB(readline, readline)
|
||||
AC_CHECK_HEADERS_ONCE([sys/time.h stdint.h readline/readline.h readline/history.h])
|
||||
|
||||
dnl Integer sizes
|
||||
AC_CHECK_SIZEOF(unsigned int)
|
||||
@@ -84,7 +85,7 @@ if test "$?" != 0 ; then
|
||||
echo "*** COULD NOT DETERMINE RELEASE DATE: docs/WHATSNEW is incorrect!"
|
||||
exit 1
|
||||
fi
|
||||
AC_CHECK_FUNCS(strdup strcasecmp strncasecmp setenv unsetenv glob mbstowcs setlocale initgroups inotify_init1)
|
||||
AC_CHECK_FUNCS(strdup strcasecmp strncasecmp setenv unsetenv glob mbstowcs setlocale initgroups inotify_init1 readline)
|
||||
|
||||
VERSION=$PACKAGE_VERSION
|
||||
CONFIG_CMD="$0$ac_configure_args_raw"
|
||||
|
||||
@@ -1,6 +1,35 @@
|
||||
CHANGES TO REMIND
|
||||
|
||||
* VERSION 6.0 Patch 0 - 2025-??-??
|
||||
* VERSION 6.0 Patch 2 - 2025-09-01
|
||||
|
||||
- CHANGE: Default $ParseUntriggered to 0 instead of 1. The default
|
||||
could cause spurious warnings such as "type mismatch" warnings for
|
||||
untriggered reminders.
|
||||
|
||||
- TEST FIX: Explicitly set latitude and longitude in test files.
|
||||
|
||||
- BUG FIX: remind: Don't add lines to "readline" history unless they
|
||||
are actually being read from standard input.
|
||||
|
||||
- BUG FIX: remind: On the command-line, make "-i$foo" behave the same
|
||||
way as "-i$foo=0" as was documented in the man page.
|
||||
|
||||
- BUG FIX: remind: Clamp the output of trigger() to "1 January 1990 AT
|
||||
00:00" if the UTC flag is used, even if it would actually produce a
|
||||
result in 1989.
|
||||
|
||||
- MINOR FIX: remind: Avoid "unused result" compiler warning.
|
||||
|
||||
* VERSION 6.0 Patch 1 - 2025-08-19
|
||||
|
||||
- NEW FEATURE: remind: Add readline support if input is taken from stdin
|
||||
(ie, "remind -"). This gives you full editing support if you run
|
||||
Remind interactively.
|
||||
|
||||
- BUG FIX: remind: Fix buffer overflow in DUMPVARS command.
|
||||
Thanks to Jochen Sprickerhof for helping me find this bug.
|
||||
|
||||
* VERSION 6.0 Patch 0 - 2025-08-18
|
||||
|
||||
- MAJOR NEW FEATURE: remind: Introduction of TODOs. These are similar
|
||||
to normal reminders, but (in Agenda Mode) you keep getting reminded
|
||||
@@ -20,6 +49,11 @@ CHANGES TO REMIND
|
||||
subst_colon, subst_bang, subst_question, subst_at and subst_hash,
|
||||
respectively.
|
||||
|
||||
- SAFETY IMPROVEMENT: remind: If a function is defined in a context
|
||||
where RUN is disabled, disable RUN during the evaluation of the
|
||||
function. Also disable RUN for all subst_XXX callbacks and the
|
||||
ordx(n) callback.
|
||||
|
||||
- MAJOR IMPROVEMENTS: tkremind: TkRemind has been given an overhaul.
|
||||
The "Show Queue" and "Show Today's Reminders" windows now respect
|
||||
the color scheme. TkRemind lets you create TODO reminders and
|
||||
@@ -49,6 +83,9 @@ CHANGES TO REMIND
|
||||
- MINOR IMPROVEMENT: tkremind: TkRemind now passes all command-line
|
||||
options back to Remind.
|
||||
|
||||
- TEST IMPROVEMENT: remind: Add --flush option and use it in tests to
|
||||
have more predictable interleaving of stdout/stderr output.
|
||||
|
||||
- BUG FIX: tkremind: In a couple of places, the "eval" command was used
|
||||
where the intention was to use "catch". I blame Perl...
|
||||
|
||||
@@ -56,6 +93,11 @@ CHANGES TO REMIND
|
||||
in the JSON output, the original FROM or SCANFROM value is
|
||||
preserved, including relative SCANFROMs.
|
||||
|
||||
- BUG FIX: tkremind: Remove some extraneous semicolons.
|
||||
|
||||
- DOCUMENTATION FIX: Fix some man-page format directive errors;
|
||||
tweak wording in several pages.
|
||||
|
||||
* VERSION 5.5 Patch 0 - 2025-07-28
|
||||
|
||||
- NEW FEATURE: remind: Add the PUSH-VARS / POP-VARS commands and the
|
||||
|
||||
@@ -544,6 +544,7 @@ will produce the following \fBinfo\fR hash:
|
||||
"summary" : "None"
|
||||
},
|
||||
.fi
|
||||
.PP
|
||||
.RE
|
||||
.TP
|
||||
.B time \fIt\fR
|
||||
@@ -684,8 +685,8 @@ emits the line:
|
||||
However, back-ends should keep reading until EOF in case more data for
|
||||
subsequent months is forthcoming.
|
||||
.PP
|
||||
|
||||
.SH REM2PS PURE JSON INPUT FORMAT (-PPP OR -P+ OPTION)
|
||||
.PP
|
||||
\fBRemind \-ppp\fR and \fBremind \-p+\fR emit \fIpure JSON\fR output.
|
||||
The format is as follows:
|
||||
.PP
|
||||
|
||||
@@ -11,8 +11,9 @@ reminder or alarm can consist of a message sent to standard output, or
|
||||
a program to be executed.
|
||||
.PP
|
||||
If \fIfilename\fR is specified as a single dash '-', then \fBRemind\fR
|
||||
takes its input from standard input.
|
||||
|
||||
takes its input from standard input. In this case, if \fBRemind\fR
|
||||
has been compiled against the GNU Readline library, it will use
|
||||
Readline to give you an interactive line-editing interface.
|
||||
.PP
|
||||
If \fIfilename\fR happens to be a directory rather than a plain file,
|
||||
then \fBRemind\fR reads all of the files (but not any subdirectories!)
|
||||
@@ -618,6 +619,11 @@ queued reminders, the time limit is reset to no limit.
|
||||
.B \-\-test
|
||||
The \fB\-\-test\fR long option is only for use by the acceptance tests
|
||||
run by "make test". Do not use this option in production.
|
||||
.TP
|
||||
.B \-\-flush
|
||||
The \fB\-\-flush\fR long option makes \fBRemind\fR's standard output
|
||||
and standard error streams unbuffered. It is mostly used for testing and
|
||||
should probably not be used in production.
|
||||
.SH REMINDER FILES
|
||||
.PP
|
||||
\fBRemind\fR uses scripts to control its operation. You can use any
|
||||
@@ -2875,6 +2881,7 @@ reminders to detect duplicates. Consider the following example:
|
||||
REM Wednesday MSG Hello
|
||||
SET $DedupeReminders 1
|
||||
REM Wednesday MSG Hello
|
||||
.fi
|
||||
.PP
|
||||
Every Wednesday, \fBRemind\fR will issue \fItwo\fR "Hello" reminders.
|
||||
Because $DedupeReminders was 0 when the first "Hello" was issued, it
|
||||
@@ -2891,6 +2898,7 @@ have been done. Consider the following:
|
||||
REM MSG [a]
|
||||
set a "foo"
|
||||
REM MSG [a]
|
||||
.fi
|
||||
.PP
|
||||
The first REM will trigger and print "foo". The second will trigger and
|
||||
print "bar". The third will not trigger because it's a duplicate of the
|
||||
@@ -3187,25 +3195,26 @@ and ignore the attempt to set \fB$OnceFile\fR.
|
||||
.RE
|
||||
.TP
|
||||
.B $ParseUntriggered
|
||||
A flag indicating whether or not \fBRemind\fR should fully parse \fBREM\fR
|
||||
statements that are not triggered. 0 means to skip parsing them and 1
|
||||
(the default) means to parse them.
|
||||
A flag indicating whether or not \fBRemind\fR should fully parse
|
||||
\fBREM\fR statements that are not triggered. 0 (the default) means to
|
||||
skip parsing them and 1 means to parse them.
|
||||
.PP
|
||||
.RS
|
||||
For example, if we have the following \fBREM\fR statement:
|
||||
.PP
|
||||
.nf
|
||||
REM 2020-01-01 MSG ["bad_expression" * 2]
|
||||
REM 2020-01-01 MSG ["bad_expression" / 2]
|
||||
.fi
|
||||
.PP
|
||||
Then by default, \fBRemind\fR will fully parse the line and issue
|
||||
a "Type mismatch" error even if the reminder is not triggered. However,
|
||||
if \fB$ParseUntriggered\fR is set to 0, then \fBRemind\fR will not
|
||||
issue the error except on 2020-01-01, when the reminder is triggered.
|
||||
Then if \fB$ParseUntriggered\fR is set to 1, \fBRemind\fR will fully
|
||||
parse the line and issue a "Type mismatch" error even if the reminder
|
||||
is not triggered. However, if \fB$ParseUntriggered\fR is set to 0,
|
||||
the default, then \fBRemind\fR will not issue the error except on
|
||||
2020-01-01, when the reminder is triggered.
|
||||
.PP
|
||||
Setting \fB$ParseUntriggered\fR to 0 may in some cases slightly
|
||||
improve performance, at the risk of not catching errors until a
|
||||
reminder is triggered.
|
||||
Keeping \fB$ParseUntriggered\fR at 0 may slightly improve performance,
|
||||
at the risk of not catching errors until a reminder is triggered. We recommend
|
||||
leaving it set to 0.
|
||||
.RE
|
||||
.TP
|
||||
.B $PrefixLineNo (read-only)
|
||||
@@ -3786,7 +3795,7 @@ for the specified year. If \fIarg\fR is a \fBDATE\fR or
|
||||
after \fIarg\fR. (The time component of a datetime is ignored.) If \fIarg\fR
|
||||
is omitted, then it defaults to \fBtoday()\fR.
|
||||
.RS
|
||||
.P
|
||||
.PP
|
||||
Note that \fBeasterdate\fR computes the Western Easter. For the Orthodox
|
||||
Easter date, see \fBorthodoxeaster\fR.
|
||||
.RE
|
||||
@@ -4306,7 +4315,7 @@ Returns a string that is the ordinal number \fInum\fR. For example,
|
||||
In order to help with localization, if you define a function called
|
||||
\fBordx\fR that takes a single parameter, then calling
|
||||
\fBord\fR(\fIn\fR) invokes \fBordx\fR(\fIn\fR) and returns whatever
|
||||
it does.
|
||||
it does. During the callback to \fBordx\fR, \fBRUN\fR will be disabled.
|
||||
.RE
|
||||
.TP
|
||||
.B orthodoxeaster([dqi_arg])
|
||||
@@ -4316,7 +4325,7 @@ for the specified year. If \fIarg\fR is a \fBDATE\fR or
|
||||
after \fIarg\fR. (The time component of a datetime is ignored.) If \fIarg\fR
|
||||
is omitted, then it defaults to \fBtoday()\fR.
|
||||
.RS
|
||||
.P
|
||||
.PP
|
||||
Note that \fBorthodoxeaster\fR computes the Orthodox Easter. For the Western
|
||||
Easter date, see \fBeasterdate\fR.
|
||||
.RE
|
||||
@@ -4829,6 +4838,11 @@ Finally:
|
||||
.PP
|
||||
returns "30 November 1994 AT 22:00" for EST, which is 5 hours behind UTC.
|
||||
The value for your time zone may differ.
|
||||
.PP
|
||||
\fBtrigger()\fR will \fInever\fR return a date earlier than "1 January 1990"
|
||||
even if the UTC flag dictates that it should. So do not use it for reminders
|
||||
before about 2 January 1990 in your local time zone. I do not anticipate this
|
||||
restriction being a real problem.
|
||||
.RE
|
||||
.TP
|
||||
.B trigtags()
|
||||
@@ -5323,6 +5337,13 @@ it is ignored and the built-in function is used. To prevent conflicts
|
||||
with future versions of \fBRemind\fR (which may define more built-in
|
||||
functions), you may wish to name all user-defined functions beginning
|
||||
with an underscore.
|
||||
.TP
|
||||
o
|
||||
If a user-defined function is defined in a context where \fBRUN\fR is
|
||||
disabled, then whenever that function is called, \fBRUN\fR will be disabled
|
||||
during its evaluation, \fIeven if\fR it is called from a context where
|
||||
\fBRUN\fR is enabled.
|
||||
|
||||
.PP
|
||||
To delete a user-defined function, use \fBFUNSET\fR. This takes a
|
||||
space-separated list of user-defined functions to delete. For
|
||||
@@ -6514,6 +6535,9 @@ If you use a \fB%{name}\fR sequence and the function \fBsubst_\fIname\fR is
|
||||
not defined or returns an error, then \fB%{name}\fR is replaced with the
|
||||
empty string.
|
||||
.PP
|
||||
Note that when \fBRemind\fR invokes any callback function for a
|
||||
substitution sequence, \fBRUN\fR will be disabled.
|
||||
.PP
|
||||
.SH THE TRANSLATION TABLE
|
||||
.PP
|
||||
To assist with localizing reminder files, \fBRemind\fR maintains a
|
||||
|
||||
@@ -98,12 +98,13 @@ The fifth group of controls associates a time and possible duration
|
||||
with the reminder. You can also specify advance notice, possibly
|
||||
repeating.
|
||||
|
||||
The sixth control allows you to specify whether the reminder is a TODO,
|
||||
and if so, its completion date. Double-clicking in the "Complete through:"
|
||||
field automatically fills in the date of the calendar entry. Otherwise,
|
||||
enter a possible completion date in the form YYYY-MM-DD. You can also enter
|
||||
a number in the "Max overdue days:" field to limit how many days past the
|
||||
due date \fBRemind\fR will keep reminding you of the TODO.
|
||||
The sixth control allows you to specify whether the reminder is a
|
||||
TODO, and if so, its completion date. Typing a slash "/" in the
|
||||
"Complete through:" field automatically fills in the date of the
|
||||
calendar entry. Otherwise, enter a completion date in the form
|
||||
YYYY-MM-DD. You can also enter a number in the "Max overdue days:"
|
||||
field to limit how many days past the due date \fBRemind\fR will keep
|
||||
reminding you of the TODO.
|
||||
|
||||
The seventh control specifies what \fBRemind\fR should do if a reminder
|
||||
falls on a holiday or weekend.
|
||||
@@ -296,12 +297,12 @@ IP address of your SMTP server here.
|
||||
.TP
|
||||
.B Text Editor
|
||||
This specifies a text editor to invoke when a reminder is right-clicked.
|
||||
The characters "%d" are replaced with the lined number of the file
|
||||
containing the reminder, and "%s" are replaced with the file name.
|
||||
The sequence "%d" is replaced with the line number of the file
|
||||
containing the reminder, and "%s" is replaced with the file name.
|
||||
Useful strings might be "emacs +%d %s" or "gvim +%d %s"
|
||||
|
||||
.TP
|
||||
.B Extra Argument for Remind
|
||||
.B Extra Arguments for Remind
|
||||
This specifies any extra arguments that should be passed to Remind
|
||||
when \fBTkRemind\fR invokes \fBremind\fR. Unless you know what
|
||||
you are doing, leave this blank.
|
||||
|
||||
@@ -1033,7 +1033,7 @@ proc SaveOptions { w } {
|
||||
set n [expr $i*7]
|
||||
for {set j 0} {$j < 7} {incr j} {
|
||||
set f [expr $n+$j]
|
||||
.cal.l$f configure -anchor $Option(DayAnchor);
|
||||
.cal.l$f configure -anchor $Option(DayAnchor)
|
||||
}
|
||||
}
|
||||
.b.status configure -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||
@@ -1047,8 +1047,8 @@ proc SaveOptions { w } {
|
||||
.b.queue configure -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||
.b.quit configure -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||
.b.options configure -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||
. configure -background $Option(LineColor);
|
||||
.h configure -background $Option(LineColor);
|
||||
. configure -background $Option(LineColor)
|
||||
.h configure -background $Option(LineColor)
|
||||
.cal configure -background $Option(LineColor)
|
||||
.b configure -background $Option(LineColor)
|
||||
}
|
||||
@@ -1189,7 +1189,7 @@ proc FillCalWindow {} {
|
||||
gets $file line
|
||||
set DayNames {}
|
||||
foreach day $line {
|
||||
set day [regsub -all {_} $day " "];
|
||||
set day [regsub -all {_} $day " "]
|
||||
lappend DayNames $day
|
||||
}
|
||||
|
||||
@@ -1385,7 +1385,7 @@ proc ThisMonth {} {
|
||||
|
||||
# Do nothing if already there
|
||||
if { $CurMonth == $TodayMonth && $CurYear == $TodayYear } {
|
||||
return 0;
|
||||
return 0
|
||||
}
|
||||
set CurMonth $TodayMonth
|
||||
set CurYear $TodayYear
|
||||
@@ -1733,6 +1733,7 @@ proc complete_through_today { w } {
|
||||
} else {
|
||||
$w.complete_through insert end [clock format [clock seconds] -format %Y-%m-%d]
|
||||
}
|
||||
return -code break
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
@@ -1970,7 +1971,7 @@ proc CreateModifyDialog {w day firstDay args} {
|
||||
$w.todobut deselect
|
||||
label $w.lcomplete -text "Complete through: "
|
||||
entry $w.complete_through -width 20
|
||||
bind $w.complete_through <Double-Button-1> [list complete_through_today $w]
|
||||
bind $w.complete_through <KeyPress-slash> [list complete_through_today $w]
|
||||
balloon_add_help $w.complete_through "Enter the date of completed TODO in the form YYYY-MM-DD"
|
||||
label $w.loverdue -text "Max overdue days: "
|
||||
entry $w.max_overdue -width 6
|
||||
@@ -3034,10 +3035,10 @@ proc DaemonReadable { file } {
|
||||
return
|
||||
}
|
||||
if {[catch {set obj [::json::json2dict $line]}]} {
|
||||
return;
|
||||
return
|
||||
}
|
||||
if {![dict exists $obj response]} {
|
||||
return;
|
||||
return
|
||||
}
|
||||
set response [dict get $obj response]
|
||||
switch -- $response {
|
||||
@@ -3838,7 +3839,7 @@ proc details_enter { w } {
|
||||
lappend lines [list "URL:" "Middle-click to open [dict get $info url]"]
|
||||
}
|
||||
if {[llength $lines] < 1} {
|
||||
return;
|
||||
return
|
||||
}
|
||||
balloon_cancel_timer
|
||||
|
||||
@@ -4254,7 +4255,7 @@ proc DisplayTime {} {
|
||||
# .moon_last
|
||||
#***********************************************************************
|
||||
proc CreateMoonWindows {} {
|
||||
global Option;
|
||||
global Option
|
||||
catch { destroy .moon_new }
|
||||
catch { destroy .moon_first }
|
||||
catch { destroy .moon_full }
|
||||
@@ -4381,7 +4382,7 @@ proc ShowTodaysReminders { force date } {
|
||||
if {$TwentyFourHourMode} {
|
||||
append cmdline "-b1 "
|
||||
}
|
||||
append cmdline $Option(ExtraRemindArgs);
|
||||
append cmdline $Option(ExtraRemindArgs)
|
||||
append cmdline " $ReminderFile"
|
||||
if {"$date" != ""} {
|
||||
append cmdline " $date"
|
||||
@@ -4547,10 +4548,10 @@ proc compare_reminders { a b } {
|
||||
set a_prio [dict get $a priority]
|
||||
set b_prio [dict get $b priority]
|
||||
if {$a_prio < $b_prio} {
|
||||
return -1;
|
||||
return -1
|
||||
}
|
||||
if {$a_prio > $b_prio} {
|
||||
return 1;
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -45,6 +45,9 @@
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the `readline' function. */
|
||||
#undef HAVE_READLINE
|
||||
|
||||
/* Define to 1 if you have the `strcasecmp' function. */
|
||||
#undef HAVE_STRCASECMP
|
||||
|
||||
@@ -81,6 +84,12 @@
|
||||
/* Define to 1 if you have the <wctype.h> header file. */
|
||||
#undef HAVE_WCTYPE_H
|
||||
|
||||
/* Define to 1 if you have the <readline/history.h> header file. */
|
||||
#undef HAVE_READLINE_HISTORY_H
|
||||
|
||||
/* Define to 1 if you have the <readline/readline.h> header file. */
|
||||
#undef HAVE_READLINE_READLINE_H
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
|
||||
12
src/custom.h
12
src/custom.h
@@ -159,3 +159,15 @@
|
||||
#else
|
||||
#undef REM_USE_WCHAR
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_READLINE) && defined(HAVE_READLINE_READLINE_H)
|
||||
#define USE_READLINE 1
|
||||
#else
|
||||
#undef USE_READLINE
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_READLINE) && defined(HAVE_READLINE_READLINE_H) && defined(HAVE_READLINE_HISTORY_H)
|
||||
#define USE_READLINE_HISTORY 1
|
||||
#else
|
||||
#undef USE_READLINE_HISTORY
|
||||
#endif
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
/* The default values are initially set to the city hall in Ottawa, */
|
||||
/* Ontario, Canada. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define DEFAULT_LATITUDE 45.420556
|
||||
#define DEFAULT_LONGITUDE -75.689722
|
||||
#define DEFAULT_LATITUDE 45.42055555555555
|
||||
#define DEFAULT_LONGITUDE -75.68944444444445
|
||||
#define LOCATION "Ottawa"
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
@@ -159,3 +159,15 @@
|
||||
#else
|
||||
#undef REM_USE_WCHAR
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_READLINE) && defined(HAVE_READLINE_READLINE_H)
|
||||
#define USE_READLINE 1
|
||||
#else
|
||||
#undef USE_READLINE
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_READLINE) && defined(HAVE_READLINE_READLINE_H) && defined(HAVE_READLINE_HISTORY_H)
|
||||
#define USE_READLINE_HISTORY 1
|
||||
#else
|
||||
#undef USE_READLINE_HISTORY
|
||||
#endif
|
||||
|
||||
@@ -145,7 +145,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig const *tt, int
|
||||
if (func && check_subst_args(func, 1)) {
|
||||
snprintf(s, sizeof(s), "subst_ampm(%d)", h);
|
||||
expr = (char const *) s;
|
||||
r = EvalExpr(&expr, &v, NULL);
|
||||
r = EvalExprRunDisabled(&expr, &v, NULL);
|
||||
if (r == OK) {
|
||||
if (!DoCoerce(STR_TYPE, &v)) {
|
||||
snprintf(mypm, sizeof(mypm), "%s", v.v.str);
|
||||
@@ -173,7 +173,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig const *tt, int
|
||||
if (func && check_subst_args(func, 1)) {
|
||||
snprintf(s, sizeof(s), "subst_ampm(%d)", ch);
|
||||
expr = (char const *) s;
|
||||
r = EvalExpr(&expr, &v, NULL);
|
||||
r = EvalExprRunDisabled(&expr, &v, NULL);
|
||||
if (r == OK) {
|
||||
if (!DoCoerce(STR_TYPE, &v)) {
|
||||
snprintf(mycpm, sizeof(mycpm), "%s", v.v.str);
|
||||
@@ -196,7 +196,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig const *tt, int
|
||||
if (func && check_subst_args(func, 1)) {
|
||||
snprintf(s, sizeof(s), "subst_ordinal(%d)", d);
|
||||
expr = (char const *) s;
|
||||
r = EvalExpr(&expr, &v, NULL);
|
||||
r = EvalExprRunDisabled(&expr, &v, NULL);
|
||||
if (r == OK) {
|
||||
if (!DoCoerce(STR_TYPE, &v)) {
|
||||
snprintf(myplu, sizeof(myplu), "%s", v.v.str);
|
||||
@@ -360,7 +360,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig const *tt, int
|
||||
snprintf(ss, sizeof(s) - (ss-s), "(%d,'%04d-%02d-%02d',%02d:%02d)",
|
||||
altmode ? 1 : 0, y, m+1, d, h, min);
|
||||
expr = (char const *) s;
|
||||
r = EvalExpr(&expr, &v, NULL);
|
||||
r = EvalExprRunDisabled(&expr, &v, NULL);
|
||||
if (r == OK) {
|
||||
if (!DoCoerce(STR_TYPE, &v)) {
|
||||
if (DBufPuts(dbuf, v.v.str) != OK) {
|
||||
@@ -383,7 +383,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig const *tt, int
|
||||
snprintf(s, sizeof(s), "%s(%d,'%04d-%02d-%02d',%02d:%02d)",
|
||||
substname, altmode ? 1 : 0, y, m+1, d, h, min);
|
||||
expr = (char const *) s;
|
||||
r = EvalExpr(&expr, &v, NULL);
|
||||
r = EvalExprRunDisabled(&expr, &v, NULL);
|
||||
if (r == OK) {
|
||||
if (v.type != INT_TYPE || v.v.val != 0) {
|
||||
if (!DoCoerce(STR_TYPE, &v)) {
|
||||
@@ -439,7 +439,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig const *tt, int
|
||||
snprintf(s, sizeof(s), "%s(%d,'%04d-%02d-%02d',%02d:%02d)",
|
||||
substname, altmode ? 1 : 0, y, m+1, d, h, min);
|
||||
expr = (char const *) s;
|
||||
r = EvalExpr(&expr, &v, NULL);
|
||||
r = EvalExprRunDisabled(&expr, &v, NULL);
|
||||
if (r == OK) {
|
||||
if (v.type != INT_TYPE || v.v.val != 0) {
|
||||
if (!DoCoerce(STR_TYPE, &v)) {
|
||||
|
||||
29
src/expr.c
29
src/expr.c
@@ -570,7 +570,7 @@ eval_builtin(expr_node *node, Value *locals, Value *ans, int *nonconst)
|
||||
/* All went well; copy the result destructively */
|
||||
(*ans) = info.retval;
|
||||
|
||||
/* Special case of const cunction */
|
||||
/* Special case of const function */
|
||||
if (!strcmp(f->name, "const")) {
|
||||
if (*nonconst) {
|
||||
nonconst_debug(0, tr("Non-constant expression converted to constant by `const' built-in function"));
|
||||
@@ -694,6 +694,7 @@ eval_userfunc(expr_node *node, Value *locals, Value *ans, int *nonconst)
|
||||
Value *new_locals = NULL;
|
||||
expr_node *kid;
|
||||
int i, r, j, pushed;
|
||||
int old_rundisabled;
|
||||
|
||||
/* If we have <= STACK_ARGS_MAX, store them on the stack here */
|
||||
Value stack_locals[STACK_ARGS_MAX];
|
||||
@@ -781,9 +782,15 @@ eval_userfunc(expr_node *node, Value *locals, Value *ans, int *nonconst)
|
||||
|
||||
DBG(debug_enter_userfunc(node, new_locals, f->nargs));
|
||||
|
||||
old_rundisabled = RunDisabled;
|
||||
if (f->run_disabled) {
|
||||
RunDisabled |= RUN_UF;
|
||||
}
|
||||
/* Evaluate the function's expr_node tree */
|
||||
r = evaluate_expr_node(f->node, new_locals, ans, nonconst);
|
||||
|
||||
RunDisabled = old_rundisabled;
|
||||
|
||||
DBG(debug_exit_userfunc(node, ans, r, new_locals, f->nargs));
|
||||
|
||||
if (r != OK) {
|
||||
@@ -2869,9 +2876,29 @@ static char const *get_operator_name(expr_node *node)
|
||||
else return "UNKNOWN_OPERATOR";
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* EvalExprRunDisabled - parse and evaluate an expression */
|
||||
/* */
|
||||
/* Evaluate an expression. Return 0 if OK, non-zero if error */
|
||||
/* Put the result into value pointed to by v. During */
|
||||
/* evaluation, RUN will be disabled */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
int EvalExprRunDisabled(char const **e, Value *v, ParsePtr p)
|
||||
{
|
||||
int old_run_disabled = RunDisabled;
|
||||
int r;
|
||||
RunDisabled |= RUN_CB;
|
||||
r = EvalExpr(e, v, p);
|
||||
RunDisabled = old_run_disabled;
|
||||
return r;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* EvalExpr - parse and evaluate an expression. */
|
||||
/* */
|
||||
/* Evaluate an expression. Return 0 if OK, non-zero if error */
|
||||
/* Put the result into value pointed to by v. */
|
||||
/* */
|
||||
|
||||
58
src/files.c
58
src/files.c
@@ -41,6 +41,13 @@
|
||||
#include "globals.h"
|
||||
#include "err.h"
|
||||
|
||||
#ifdef USE_READLINE
|
||||
#include <readline/readline.h>
|
||||
#endif
|
||||
#ifdef USE_READLINE_HISTORY
|
||||
#include <readline/history.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* Convenient macros for closing files */
|
||||
#define FCLOSE(fp) ((((fp)!=stdin)) ? (fclose(fp),(fp)=NULL) : ((fp)=NULL))
|
||||
@@ -134,6 +141,9 @@ void InitFiles(void)
|
||||
fprintf(ErrFp, "Unable to initialize filename hash table: Out of memory. Exiting.\n");
|
||||
exit(1);
|
||||
}
|
||||
#ifdef USE_READLINE_HISTORY
|
||||
using_history();
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetCurrentFilename(char const *fname)
|
||||
@@ -268,6 +278,8 @@ int ReadLine(void)
|
||||
return ReadLineFromFile(0);
|
||||
}
|
||||
|
||||
#define IS_INTERACTIVE() (fileno(fp) == STDIN_FILENO && isatty(STDIN_FILENO) && isatty(STDOUT_FILENO))
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* ReadLineFromFile */
|
||||
@@ -280,6 +292,11 @@ static int ReadLineFromFile(int use_pclose)
|
||||
int l;
|
||||
char copy_buffer[4096];
|
||||
size_t n;
|
||||
int force_eof = 0;
|
||||
|
||||
#ifdef USE_READLINE
|
||||
int read_some = 0;
|
||||
#endif
|
||||
|
||||
DynamicBuffer buf;
|
||||
|
||||
@@ -288,17 +305,51 @@ static int ReadLineFromFile(int use_pclose)
|
||||
|
||||
LineNoStart = LineNo+1;
|
||||
while(fp) {
|
||||
#ifdef USE_READLINE
|
||||
if (IS_INTERACTIVE()) {
|
||||
char *lin;
|
||||
if (should_ignore_line()) {
|
||||
if (read_some) {
|
||||
lin = readline("Rem...? ");
|
||||
} else {
|
||||
lin = readline("Remind? ");
|
||||
}
|
||||
} else {
|
||||
if (read_some) {
|
||||
lin = readline("Rem...> ");
|
||||
} else {
|
||||
lin = readline("Remind> ");
|
||||
}
|
||||
}
|
||||
if (lin) {
|
||||
read_some = 1;
|
||||
DBufFree(&buf);
|
||||
if (DBufPuts(&buf, lin) != OK) {
|
||||
free(lin);
|
||||
DBufFree(&buf);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
free(lin);
|
||||
force_eof = 0;
|
||||
} else {
|
||||
force_eof = 1;
|
||||
}
|
||||
} else {
|
||||
#endif
|
||||
if (DBufGets(&buf, fp) != OK) {
|
||||
DBufFree(&LineBuffer);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
#ifdef USE_READLINE
|
||||
}
|
||||
#endif
|
||||
LineNo++;
|
||||
if (ferror(fp)) {
|
||||
DBufFree(&buf);
|
||||
DBufFree(&LineBuffer);
|
||||
return E_IO_ERR;
|
||||
}
|
||||
if (feof(fp)) {
|
||||
if (feof(fp) || force_eof) {
|
||||
if (use_pclose) {
|
||||
PCLOSE(fp);
|
||||
} else {
|
||||
@@ -360,6 +411,11 @@ static int ReadLineFromFile(int use_pclose)
|
||||
CurLine = DBufValue(&LineBuffer);
|
||||
}
|
||||
|
||||
#ifdef USE_READLINE_HISTORY
|
||||
if (fp && IS_INTERACTIVE()) {
|
||||
add_history(CurLine);
|
||||
}
|
||||
#endif
|
||||
got_a_fresh_line();
|
||||
clear_callstack();
|
||||
if (DebugFlag & DB_ECHO_LINE) OutputLine(ErrFp);
|
||||
|
||||
29
src/funcs.c
29
src/funcs.c
@@ -1165,11 +1165,14 @@ static int FOrd(func_info *info)
|
||||
ASSERT_TYPE(0, INT_TYPE);
|
||||
|
||||
if (!in_ford && UserFuncExists("ordx") == 1) {
|
||||
/* Can't use EvalExprRunDisabled here because we need
|
||||
the nonconst result */
|
||||
expr_node *n;
|
||||
int r;
|
||||
char const *e = buf;
|
||||
Value val;
|
||||
int nonconst;
|
||||
int old_rundisabled;
|
||||
|
||||
val.type = ERR_TYPE;
|
||||
snprintf(buf, sizeof(buf), "ordx(%d)", ARGV(0));
|
||||
@@ -1178,7 +1181,10 @@ static int FOrd(func_info *info)
|
||||
return r;
|
||||
}
|
||||
in_ford = 1;
|
||||
old_rundisabled = RunDisabled;
|
||||
RunDisabled |= RUN_CB;
|
||||
r = evaluate_expr_node(n, NULL, &val, &nonconst);
|
||||
RunDisabled = old_rundisabled;
|
||||
in_ford = 0;
|
||||
free_expr_tree(n);
|
||||
if (r != OK) {
|
||||
@@ -2173,6 +2179,10 @@ static int FTrigger(func_info *info)
|
||||
tim = ARGV(1);
|
||||
if (ARGV(2)) {
|
||||
UTCToLocal(date, tim, &date, &tim);
|
||||
if (date < 0) {
|
||||
date = 0;
|
||||
tim = 0;
|
||||
}
|
||||
}
|
||||
} else if (Nargs > 1) {
|
||||
/* Date Time */
|
||||
@@ -2187,6 +2197,10 @@ static int FTrigger(func_info *info)
|
||||
ASSERT_TYPE(1, INT_TYPE);
|
||||
if (ARGV(1)) {
|
||||
UTCToLocal(date, tim, &date, &tim);
|
||||
if (date < 0) {
|
||||
date = 0;
|
||||
tim = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4156,7 +4170,7 @@ FEval(func_info *info)
|
||||
{
|
||||
expr_node *n;
|
||||
int r;
|
||||
int run_was_enabled = 0;
|
||||
int old_run_disabled;
|
||||
|
||||
ASSERT_TYPE(0, STR_TYPE);
|
||||
char const *e = ARGSTR(0);
|
||||
@@ -4168,14 +4182,13 @@ FEval(func_info *info)
|
||||
}
|
||||
|
||||
/* Disable shell() command in eval */
|
||||
if (! (RunDisabled & RUN_IN_EVAL)) {
|
||||
run_was_enabled = 1;
|
||||
RunDisabled |= RUN_IN_EVAL;
|
||||
}
|
||||
old_run_disabled = RunDisabled;
|
||||
RunDisabled |= RUN_IN_EVAL;
|
||||
|
||||
r = evaluate_expr_node(n, NULL, &(info->retval), &(info->nonconst));
|
||||
if (run_was_enabled) {
|
||||
RunDisabled &= ~RUN_IN_EVAL;
|
||||
}
|
||||
|
||||
RunDisabled = old_run_disabled;
|
||||
|
||||
free_expr_tree(n);
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ EXTERN INIT( int SortByPrio, SORT_NONE);
|
||||
EXTERN INIT( int UntimedBeforeTimed, 0);
|
||||
EXTERN INIT( int DefaultPrio, NO_PRIORITY);
|
||||
EXTERN INIT( int SysTime, -1);
|
||||
EXTERN INIT( int ParseUntriggered, 1);
|
||||
EXTERN INIT( int ParseUntriggered, 0);
|
||||
|
||||
EXTERN char const *InitialFile;
|
||||
EXTERN int FileAccessDate;
|
||||
|
||||
21
src/init.c
21
src/init.c
@@ -1017,17 +1017,15 @@ static void InitializeVar(char const *str)
|
||||
return;
|
||||
}
|
||||
if (!*str) {
|
||||
/* Setting a system var does require =expr on the commandline */
|
||||
if (*varname == '$') {
|
||||
fprintf(ErrFp, GetErr(M_I_OPTION), GetErr(E_MISS_EQ));
|
||||
fprintf(ErrFp, "\n");
|
||||
return;
|
||||
}
|
||||
val.type = INT_TYPE;
|
||||
val.v.val = 0;
|
||||
r = SetVar(varname, &val, 1);
|
||||
if (!r) {
|
||||
r = PreserveVar(varname);
|
||||
if (*varname == '$') {
|
||||
r = SetSysVar(varname+1, &val);
|
||||
} else {
|
||||
r = SetVar(varname, &val, 1);
|
||||
if (!r) {
|
||||
r = PreserveVar(varname);
|
||||
}
|
||||
}
|
||||
if (r) {
|
||||
fprintf(ErrFp, GetErr(M_I_OPTION), GetErr(r));
|
||||
@@ -1166,6 +1164,11 @@ ProcessLongOption(char const *arg)
|
||||
TodoFilter = ONLY_EVENTS;
|
||||
return;
|
||||
}
|
||||
if (!strcmp(arg, "flush")) {
|
||||
setvbuf(stdout, NULL, _IONBF, 0);
|
||||
setvbuf(stderr, NULL, _IONBF, 0);
|
||||
return;
|
||||
}
|
||||
if (!strcmp(arg, "json")) {
|
||||
JSONMode = 1;
|
||||
DontQueue = 1;
|
||||
|
||||
@@ -2122,6 +2122,7 @@ System(char const *cmd, int is_queued)
|
||||
int fd;
|
||||
int status;
|
||||
int do_exit = 0;
|
||||
|
||||
if (is_queued && IsServerMode()) {
|
||||
do_exit = 1;
|
||||
/* Server mode... redirect stdin and stdout to /dev/null */
|
||||
@@ -2151,10 +2152,9 @@ System(char const *cmd, int is_queued)
|
||||
}
|
||||
/* This is the child process or original if we never forked */
|
||||
if (JSONMode) {
|
||||
|
||||
(void) system_to_stderr(cmd);
|
||||
} else {
|
||||
(void) system(cmd);
|
||||
(void) system1(cmd);
|
||||
}
|
||||
if (do_exit) {
|
||||
/* In the child process, so exit! */
|
||||
|
||||
@@ -66,6 +66,7 @@ void unlimit_execution_time(void);
|
||||
expr_node *free_expr_tree(expr_node *node);
|
||||
expr_node *clone_expr_tree(expr_node const *node, int *r);
|
||||
int EvalExpr (char const **e, Value *v, ParsePtr p);
|
||||
int EvalExprRunDisabled(char const **e, Value *v, ParsePtr p);
|
||||
int DoCoerce (char type, Value *v);
|
||||
char const *PrintValue (Value *v, FILE *fp);
|
||||
int CopyValue (Value *dest, const Value *src);
|
||||
@@ -294,3 +295,4 @@ int get_scanfrom(Trigger const *t);
|
||||
void remove_trailing_newlines(DynamicBuffer *buf);
|
||||
void set_cloexec(int fd);
|
||||
int system_to_stderr(char const *cmd);
|
||||
int system1(char const *cmd);
|
||||
|
||||
@@ -395,7 +395,6 @@ void HandleQueuedReminders(void)
|
||||
(MaxLateMinutes == 0 || SystemTime(1) - (q->tt.nexttime * 60) <= 60 * MaxLateMinutes))) {
|
||||
/* Trigger the reminder */
|
||||
CreateParser(q->text, &p);
|
||||
RunDisabled = q->RunDisabled;
|
||||
if (IsServerMode() && q->typ != RUN_TYPE) {
|
||||
if (DaemonJSON) {
|
||||
printf("{\"response\":\"reminder\",");
|
||||
@@ -640,13 +639,15 @@ static int CalculateNextTimeUsingSched(QueuedRem *q)
|
||||
return NO_TIME;
|
||||
}
|
||||
|
||||
RunDisabled = q->RunDisabled; /* Don't want weird scheduling functions
|
||||
to be a security hole! */
|
||||
while(1) {
|
||||
char exprBuf[VAR_NAME_LEN+32];
|
||||
snprintf(exprBuf, sizeof(exprBuf), "%s(%d)", q->sched, q->ntrig);
|
||||
s = exprBuf;
|
||||
r = EvalExpr(&s, &v, NULL);
|
||||
if (q->RunDisabled) {
|
||||
r = EvalExprRunDisabled(&s, &v, NULL);
|
||||
} else {
|
||||
r = EvalExpr(&s, &v, NULL);
|
||||
}
|
||||
if (r) {
|
||||
q->sched[0] = 0;
|
||||
return NO_TIME;
|
||||
|
||||
@@ -263,6 +263,8 @@ typedef struct {
|
||||
#define RUN_SCRIPT 0x02
|
||||
#define RUN_NOTOWNER 0x04
|
||||
#define RUN_IN_EVAL 0x08
|
||||
#define RUN_UF 0x10 /* A user-function defined with RUN OFF */
|
||||
#define RUN_CB 0x20 /* A callback */
|
||||
|
||||
/* Flags for the SimpleCalendar format */
|
||||
#define SC_AMPM 0 /* Time shown as 3:00am, etc. */
|
||||
@@ -317,6 +319,7 @@ typedef struct udf_struct {
|
||||
int lineno_start;
|
||||
int recurse_flag;
|
||||
int been_pushed;
|
||||
int run_disabled;
|
||||
} UserFunc;
|
||||
|
||||
/* A pushed systtem variable */
|
||||
|
||||
@@ -275,6 +275,11 @@ int DoFset(ParsePtr p)
|
||||
func->lineno_start = LineNoStart;
|
||||
func->recurse_flag = 0;
|
||||
func->been_pushed = 0;
|
||||
if (RunDisabled) {
|
||||
func->run_disabled = 1;
|
||||
} else {
|
||||
func->run_disabled = 0;
|
||||
}
|
||||
if (in_constant_context()) {
|
||||
func->is_constant = 1;
|
||||
} else {
|
||||
|
||||
@@ -31,6 +31,13 @@ static char const DontEscapeMe[] =
|
||||
#include "globals.h"
|
||||
#include "protos.h"
|
||||
|
||||
/* Call this instead of system() so if called ignores return code,
|
||||
we don't get a compiler warning */
|
||||
int system1(char const *cmd)
|
||||
{
|
||||
return system(cmd);
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* system_to_stderr */
|
||||
|
||||
@@ -786,9 +786,14 @@ int DoDump(ParsePtr p)
|
||||
DumpSysVarByName(DBufValue(&buf)+1);
|
||||
} else {
|
||||
v = FindVar(DBufValue(&buf), 0);
|
||||
DBufValue(&buf)[VAR_NAME_LEN] = 0;
|
||||
if (!v) fprintf(ErrFp, "%s %s\n",
|
||||
if (!v) {
|
||||
if (DBufLen(&buf) > VAR_NAME_LEN) {
|
||||
/* Truncate over-long variable name */
|
||||
DBufValue(&buf)[VAR_NAME_LEN] = 0;
|
||||
}
|
||||
fprintf(ErrFp, "%s %s\n",
|
||||
DBufValue(&buf), UNDEF);
|
||||
}
|
||||
else {
|
||||
fprintf(ErrFp, "%s ", v->name);
|
||||
PrintValue(&(v->v), ErrFp);
|
||||
|
||||
44
tests/safety.rem
Normal file
44
tests/safety.rem
Normal file
@@ -0,0 +1,44 @@
|
||||
BANNER %
|
||||
SET $AddBlankLines 0
|
||||
|
||||
FSET danger(x) shell("echo oops")
|
||||
|
||||
RUN OFF
|
||||
FSET safe(x) shell("echo nope")
|
||||
FSET safe2(x) danger(x)
|
||||
RUN ON
|
||||
|
||||
DEBUG +x
|
||||
set a danger(1)
|
||||
set b safe(1)
|
||||
set c safe2(1)
|
||||
|
||||
PUSH-FUNCS safe
|
||||
FSET safe(x) shell("echo this will work")
|
||||
SET b safe(1)
|
||||
POP-FUNCS
|
||||
SET b safe(1)
|
||||
|
||||
FRENAME safe gloopy
|
||||
FRENAME danger bork
|
||||
set a bork(1)
|
||||
set b gloopy(1)
|
||||
FRENAME gloopy safe
|
||||
FRENAME bork danger
|
||||
|
||||
RUN OFF
|
||||
set a danger(1)
|
||||
set b safe(1)
|
||||
set b safe2(1)
|
||||
|
||||
RUN ON
|
||||
|
||||
DEBUG -x
|
||||
FSET subst_b(a, b, c) shell("echo nooooo....")
|
||||
|
||||
REM MSG [subst_b(1, 2, 3)]
|
||||
FLUSH
|
||||
REM MSG %b
|
||||
FLUSH
|
||||
REM MSG [subst_b(1, 2, 3)]
|
||||
FLUSH
|
||||
@@ -1,4 +1,6 @@
|
||||
set $AddBlankLines 0
|
||||
SET $Latitude "45.42055556"
|
||||
SET $Longitude "-75.68944444"
|
||||
banner %
|
||||
|
||||
set d '2011-01-01'
|
||||
|
||||
279
tests/test-rem
279
tests/test-rem
@@ -59,87 +59,87 @@ chmod 000 include_dir/04cantread.rem
|
||||
TEST_GETENV="foo bar baz" ; export TEST_GETENV
|
||||
echo "Test 1" > ../tests/test.out
|
||||
echo "" >> ../tests/test.out
|
||||
../src/remind -e -dxte ../tests/test.rem 16 feb 1991 12:13 2>&1 | grep -v 'TimetIs64bit' >> ../tests/test.out
|
||||
../src/remind --flush -e -dxte ../tests/test.rem 16 feb 1991 12:13 2>&1 | grep -v 'TimetIs64bit' >> ../tests/test.out
|
||||
echo "" >> ../tests/test.out
|
||||
echo "Test 2" >> ../tests/test.out
|
||||
echo "" >> ../tests/test.out
|
||||
../src/remind -p -l ../tests/test2.rem 1 aug 2007 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -p -l ../tests/test2.rem 1 aug 2007 >> ../tests/test.out 2>&1
|
||||
echo "" >> ../tests/test.out
|
||||
echo "Test 3" >> ../tests/test.out
|
||||
echo "" >> ../tests/test.out
|
||||
../src/remind -s ../tests/test2.rem 1 aug 2007 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -s ../tests/test2.rem 1 aug 2007 >> ../tests/test.out 2>&1
|
||||
echo "" >> ../tests/test.out
|
||||
echo "Test 4" >> ../tests/test.out
|
||||
echo "" >> ../tests/test.out
|
||||
../src/remind -sa ../tests/test2.rem 1 aug 2007 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -sa ../tests/test2.rem 1 aug 2007 >> ../tests/test.out 2>&1
|
||||
echo "Test 5" >> ../tests/test.out
|
||||
echo "" >> ../tests/test.out
|
||||
../src/remind -p -l -b0 ../tests/test3.rem 1 aug 2007 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -p -l -b0 ../tests/test3.rem 1 aug 2007 >> ../tests/test.out 2>&1
|
||||
echo "Test 6" >> ../tests/test.out
|
||||
echo "" >> ../tests/test.out
|
||||
../src/remind -p -l -b1 ../tests/test3.rem 1 aug 2007 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -p -l -b1 ../tests/test3.rem 1 aug 2007 >> ../tests/test.out 2>&1
|
||||
echo "Test 7" >> ../tests/test.out
|
||||
echo "" >> ../tests/test.out
|
||||
../src/remind -p -l -b2 ../tests/test3.rem 1 aug 2007 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -p -l -b2 ../tests/test3.rem 1 aug 2007 >> ../tests/test.out 2>&1
|
||||
|
||||
echo "Test 8" >> ../tests/test.out
|
||||
echo "" >> ../tests/test.out
|
||||
../src/remind -df -p -l -b2 ../tests/include_dir 1 aug 2007 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -df -p -l -b2 ../tests/include_dir 1 aug 2007 >> ../tests/test.out 2>&1
|
||||
|
||||
echo "Test 9" >> ../tests/test.out
|
||||
echo "" >> ../tests/test.out
|
||||
../src/remind -df -p -l -b2 ../tests/nonexistent_include_dir 1 aug 2007 >> ../tests/test.out 2>&1
|
||||
../src/remind -df -p -l -b2 ../tests/include_dir_no_rems 1 aug 2007 >> ../tests/test.out 2>&1
|
||||
../src/remind -df -p -l -b2 ../tests/include_test.rem 1 aug 2007 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -df -p -l -b2 ../tests/nonexistent_include_dir 1 aug 2007 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -df -p -l -b2 ../tests/include_dir_no_rems 1 aug 2007 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -df -p -l -b2 ../tests/include_test.rem 1 aug 2007 >> ../tests/test.out 2>&1
|
||||
|
||||
chmod 644 include_dir/04cantread.rem
|
||||
|
||||
# Feb 29 bug
|
||||
echo "Feb 29 Bug Test" >> ../tests/test.out
|
||||
echo 'REM Sun 29 Feb MSG [$T]' | ../src/remind -dt - 1 feb 2021 >> ../tests/test.out 2>&1
|
||||
echo 'REM Sun 29 Feb MSG [$T]' | ../src/remind --flush -dt - 1 feb 2021 >> ../tests/test.out 2>&1
|
||||
|
||||
# Day Weekday Year out-of-year bug
|
||||
echo "Mon 31 Dec Bug Test" >> ../tests/test.out
|
||||
echo 'REM Mon 31 2021 MSG [$T]' | ../src/remind -dt - 31 dec 2021 >> ../tests/test.out 2>&1
|
||||
echo 'REM Mon 31 2021 MSG [$T]' | ../src/remind --flush -dt - 31 dec 2021 >> ../tests/test.out 2>&1
|
||||
|
||||
echo "Color Test" >> ../tests/test.out
|
||||
../src/remind -ccl ../tests/colors.rem 1 aug 2007 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -ccl ../tests/colors.rem 1 aug 2007 >> ../tests/test.out 2>&1
|
||||
|
||||
echo "ANSI Color Test" >> ../tests/test.out
|
||||
../src/remind ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind -@0 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind -@1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind -@2 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind -@0,0 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind -@1,0 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind -@2,0 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind -@0,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind -@1,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind -@2,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind -@0,,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind -@1,,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind -@2,,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind -@0,0,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind -@1,0,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind -@2,0,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind -@0,1,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind -@1,1,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind -@2,1,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -@0 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -@1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -@2 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -@0,0 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -@1,0 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -@2,0 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -@0,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -@1,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -@2,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -@0,,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -@1,,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -@2,,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -@0,0,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -@1,0,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -@2,0,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -@0,1,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -@1,1,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -@2,1,1 ../tests/ansicolors.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
|
||||
echo '$AddBlankLines test' >> ../tests/test.out
|
||||
../src/remind ../tests/blanks.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind '-i$AddBlankLines=1' ../tests/blanks.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind '-i$AddBlankLines=0' ../tests/blanks.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush ../tests/blanks.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush '-i$AddBlankLines=1' ../tests/blanks.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush '-i$AddBlankLines=0' ../tests/blanks.rem 1 Jan 2022 >> ../tests/test.out 2>&1
|
||||
|
||||
echo "MON WKDAY DAY across year test" >> ../tests/test.out
|
||||
echo 'REM Mon 29 Dec MSG x' | ../src/remind -dt - 1 Jan 2000 >> ../tests/test.out 2>&1
|
||||
echo 'REM Mon 29 Dec MSG x' | ../src/remind --flush -dt - 1 Jan 2000 >> ../tests/test.out 2>&1
|
||||
|
||||
echo "Sort Test" >> ../tests/test.out
|
||||
(echo "REM AT 12:00 MSG Untimed"; echo "REM MSG Timed") | ../src/remind -q -gaaa - 1 Jan 2000 >> ../tests/test.out 2>&1
|
||||
(echo "REM AT 12:00 MSG Untimed"; echo "REM MSG Timed") | ../src/remind -q -gaaad - 1 Jan 2000 >> ../tests/test.out 2>&1
|
||||
(echo "REM AT 12:00 MSG Untimed"; echo "REM MSG Timed") | ../src/remind --flush -q -gaaa - 1 Jan 2000 >> ../tests/test.out 2>&1
|
||||
(echo "REM AT 12:00 MSG Untimed"; echo "REM MSG Timed") | ../src/remind --flush -q -gaaad - 1 Jan 2000 >> ../tests/test.out 2>&1
|
||||
|
||||
echo "Purge Test" >> ../tests/test.out
|
||||
../src/remind -j999 ../tests/purge_dir/f1.rem 3 Feb 2012 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -j999 ../tests/purge_dir/f1.rem 3 Feb 2012 >> ../tests/test.out 2>&1
|
||||
echo "F1" >> ../tests/test.out
|
||||
cat ../tests/purge_dir/f1.rem.purged >> ../tests/test.out
|
||||
echo "F2" >> ../tests/test.out
|
||||
@@ -150,7 +150,7 @@ cat ../tests/purge_dir/f3.rem.purged >> ../tests/test.out
|
||||
rm -f ../tests/purge_dir/*.rem.purged >> ../tests/test.out 2>&1
|
||||
|
||||
echo "Hush Purge Test" >> ../tests/test.out
|
||||
../src/remind -h -j999 ../tests/purge_dir/f1.rem 3 Feb 2012 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -h -j999 ../tests/purge_dir/f1.rem 3 Feb 2012 >> ../tests/test.out 2>&1
|
||||
echo "F1" >> ../tests/test.out
|
||||
cat ../tests/purge_dir/f1.rem.purged >> ../tests/test.out
|
||||
echo "F2" >> ../tests/test.out
|
||||
@@ -160,22 +160,22 @@ cat ../tests/purge_dir/f3.rem.purged >> ../tests/test.out
|
||||
|
||||
rm -f ../tests/purge_dir/*.rem.purged >> ../tests/test.out 2>&1
|
||||
|
||||
../src/remind ../tests/runtest.rem >> ../tests/test.out 2>&1
|
||||
../src/remind --flush ../tests/runtest.rem >> ../tests/test.out 2>&1
|
||||
|
||||
../src/remind -p ../tests/shade.rem 1 August 2009 | ../src/rem2ps -e -l -c3 >> ../tests/test.out 2>&1
|
||||
../src/remind -pp ../tests/shade.rem 1 August 2009 | ../src/rem2ps -e -l -c3 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -p ../tests/shade.rem 1 August 2009 | ../src/rem2ps -e -l -c3 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -pp ../tests/shade.rem 1 August 2009 | ../src/rem2ps -e -l -c3 >> ../tests/test.out 2>&1
|
||||
|
||||
TZ=America/Toronto ../src/remind ../tests/sunmoon.rem 1 Jan 2011 >> ../tests/test.out 2>&1
|
||||
TZ=America/Toronto ../src/remind --flush ../tests/sunmoon.rem 1 Jan 2011 >> ../tests/test.out 2>&1
|
||||
|
||||
# Test -a vs -aa
|
||||
../src/remind -q -a - 1 Jan 2012 9:00 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -q -a - 1 Jan 2012 9:00 <<'EOF' >> ../tests/test.out 2>&1
|
||||
REM 1 Jan 2012 AT 8:00 MSG 8am: Should not show up
|
||||
REM 1 Jan 2012 AT 9:00 MSG 9am: Should not show up
|
||||
REM 1 Jan 2012 AT 10:00 MSG 10am: Should not show up
|
||||
MSG [$DontTrigAts]
|
||||
EOF
|
||||
|
||||
../src/remind -q -a -a - 1 Jan 2012 9:00 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -q -a -a - 1 Jan 2012 9:00 <<'EOF' >> ../tests/test.out 2>&1
|
||||
REM 1 Jan 2012 AT 8:00 MSG 8am: Should not show up
|
||||
REM 1 Jan 2012 AT 9:00 MSG 9am: Should show up
|
||||
REM 1 Jan 2012 AT 10:00 MSG 10am: Should show up
|
||||
@@ -183,12 +183,12 @@ MSG [$DontTrigAts]
|
||||
EOF
|
||||
|
||||
# OMITFUNC should indicate nonconst_expr
|
||||
../src/remind -pp - 1 jan 2012 9:00 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -pp - 1 jan 2012 9:00 <<'EOF' >> ../tests/test.out 2>&1
|
||||
REM Mon OMITFUNC foo MSG bar
|
||||
EOF
|
||||
|
||||
# Test default color
|
||||
../src/remind -pppq - 1 Jan 2012 9:00 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -pppq - 1 Jan 2012 9:00 <<'EOF' >> ../tests/test.out 2>&1
|
||||
REM 2 MSG Normal
|
||||
SET $DefaultColor "255 0 0"
|
||||
REM 3 \
|
||||
@@ -201,7 +201,7 @@ SET $DefaultColor \
|
||||
EOF
|
||||
|
||||
# Test default color with weekly calendar
|
||||
../src/remind -pq+ - 1 Jan 2012 9:00 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -pq+ - 1 Jan 2012 9:00 <<'EOF' >> ../tests/test.out 2>&1
|
||||
REM 2 MSG Normal
|
||||
SET $DefaultColor "255 0 0"
|
||||
REM 3 MSG %"Red%" on the calendar!
|
||||
@@ -212,18 +212,18 @@ SET $DefaultColor "256 0 0"
|
||||
EOF
|
||||
|
||||
# Test stdout
|
||||
../src/remind - 1 jan 2012 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush - 1 jan 2012 <<'EOF' >> ../tests/test.out 2>&1
|
||||
BANNER %
|
||||
MSG STDOUT is a: [stdout()]%
|
||||
EOF
|
||||
|
||||
../src/remind - 1 jan 2012 <<'EOF' 2>&1 | cat >> ../tests/test.out
|
||||
../src/remind --flush - 1 jan 2012 <<'EOF' 2>&1 | cat >> ../tests/test.out
|
||||
BANNER %
|
||||
MSG STDOUT is a: [stdout()]%
|
||||
EOF
|
||||
|
||||
# Test -@ option
|
||||
../src/remind -w,0,0 -@0,,1 -c - 1 Jan 2020 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -w,0,0 -@0,,1 -c - 1 Jan 2020 <<'EOF' >> ../tests/test.out 2>&1
|
||||
SET $SuppressLRM 1
|
||||
rem 1 SPECIAL COLOR 0 0 0 BLACK
|
||||
rem 2 SPECIAL COLOR 0 0 65 BLUE
|
||||
@@ -246,7 +246,7 @@ rem 23 SPECIAL COLOR 200 0 200 BRIGHT MAGENTA
|
||||
rem 24 SPECIAL COLOR 200 200 0 BRIGHT YELLOW
|
||||
rem 25 SPECIAL COLOR 200 200 200 BRIGHT WHITE
|
||||
EOF
|
||||
../src/remind -w,0,0 -@0,0,1 -c - 1 Jan 2020 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -w,0,0 -@0,0,1 -c - 1 Jan 2020 <<'EOF' >> ../tests/test.out 2>&1
|
||||
SET $SuppressLRM 1
|
||||
rem 1 SPECIAL COLOR 0 0 0 BLACK
|
||||
rem 2 SPECIAL COLOR 0 0 65 BLUE
|
||||
@@ -269,7 +269,7 @@ rem 23 SPECIAL COLOR 200 0 200 BRIGHT MAGENTA
|
||||
rem 24 SPECIAL COLOR 200 200 0 BRIGHT YELLOW
|
||||
rem 25 SPECIAL COLOR 200 200 200 BRIGHT WHITE
|
||||
EOF
|
||||
../src/remind -w,0,0 -@0,1,1 -c - 1 Jan 2020 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -w,0,0 -@0,1,1 -c - 1 Jan 2020 <<'EOF' >> ../tests/test.out 2>&1
|
||||
SET $SuppressLRM 1
|
||||
rem 1 SPECIAL COLOR 0 0 0 BLACK
|
||||
rem 2 SPECIAL COLOR 0 0 65 BLUE
|
||||
@@ -292,7 +292,7 @@ rem 23 SPECIAL COLOR 200 0 200 BRIGHT MAGENTA
|
||||
rem 24 SPECIAL COLOR 200 200 0 BRIGHT YELLOW
|
||||
rem 25 SPECIAL COLOR 200 200 200 BRIGHT WHITE
|
||||
EOF
|
||||
../src/remind -w,0,0 -@1,,1 -c - 1 Jan 2020 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -w,0,0 -@1,,1 -c - 1 Jan 2020 <<'EOF' >> ../tests/test.out 2>&1
|
||||
SET $SuppressLRM 1
|
||||
rem 1 SPECIAL COLOR 0 0 0 BLACK
|
||||
rem 2 SPECIAL COLOR 0 0 65 BLUE
|
||||
@@ -315,7 +315,7 @@ rem 23 SPECIAL COLOR 200 0 200 BRIGHT MAGENTA
|
||||
rem 24 SPECIAL COLOR 200 200 0 BRIGHT YELLOW
|
||||
rem 25 SPECIAL COLOR 200 200 200 BRIGHT WHITE
|
||||
EOF
|
||||
../src/remind -w,0,0 -@1,0,1 -c - 1 Jan 2020 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -w,0,0 -@1,0,1 -c - 1 Jan 2020 <<'EOF' >> ../tests/test.out 2>&1
|
||||
SET $SuppressLRM 1
|
||||
rem 1 SPECIAL COLOR 0 0 0 BLACK
|
||||
rem 2 SPECIAL COLOR 0 0 65 BLUE
|
||||
@@ -338,7 +338,7 @@ rem 23 SPECIAL COLOR 200 0 200 BRIGHT MAGENTA
|
||||
rem 24 SPECIAL COLOR 200 200 0 BRIGHT YELLOW
|
||||
rem 25 SPECIAL COLOR 200 200 200 BRIGHT WHITE
|
||||
EOF
|
||||
../src/remind -w,0,0 -@1,1,1 -c - 1 Jan 2020 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -w,0,0 -@1,1,1 -c - 1 Jan 2020 <<'EOF' >> ../tests/test.out 2>&1
|
||||
SET $SuppressLRM 1
|
||||
rem 1 SPECIAL COLOR 0 0 0 BLACK
|
||||
rem 2 SPECIAL COLOR 0 0 65 BLUE
|
||||
@@ -361,7 +361,7 @@ rem 23 SPECIAL COLOR 200 0 200 BRIGHT MAGENTA
|
||||
rem 24 SPECIAL COLOR 200 200 0 BRIGHT YELLOW
|
||||
rem 25 SPECIAL COLOR 200 200 200 BRIGHT WHITE
|
||||
EOF
|
||||
../src/remind -w,0,0 -@2,,1 -c - 1 Jan 2020 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -w,0,0 -@2,,1 -c - 1 Jan 2020 <<'EOF' >> ../tests/test.out 2>&1
|
||||
SET $SuppressLRM 1
|
||||
rem 1 SPECIAL COLOR 0 0 0 BLACK
|
||||
rem 2 SPECIAL COLOR 0 0 65 BLUE
|
||||
@@ -384,7 +384,7 @@ rem 23 SPECIAL COLOR 200 0 200 BRIGHT MAGENTA
|
||||
rem 24 SPECIAL COLOR 200 200 0 BRIGHT YELLOW
|
||||
rem 25 SPECIAL COLOR 200 200 200 BRIGHT WHITE
|
||||
EOF
|
||||
../src/remind -w,0,0 -@2,0,1 -c - 1 Jan 2020 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -w,0,0 -@2,0,1 -c - 1 Jan 2020 <<'EOF' >> ../tests/test.out 2>&1
|
||||
SET $SuppressLRM 1
|
||||
rem 1 SPECIAL COLOR 0 0 0 BLACK
|
||||
rem 2 SPECIAL COLOR 0 0 65 BLUE
|
||||
@@ -407,7 +407,7 @@ rem 23 SPECIAL COLOR 200 0 200 BRIGHT MAGENTA
|
||||
rem 24 SPECIAL COLOR 200 200 0 BRIGHT YELLOW
|
||||
rem 25 SPECIAL COLOR 200 200 200 BRIGHT WHITE
|
||||
EOF
|
||||
../src/remind -w,0,0 -@2,1,1 -c - 1 Jan 2020 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -w,0,0 -@2,1,1 -c - 1 Jan 2020 <<'EOF' >> ../tests/test.out 2>&1
|
||||
SET $SuppressLRM 1
|
||||
rem 1 SPECIAL COLOR 0 0 0 BLACK
|
||||
rem 2 SPECIAL COLOR 0 0 65 BLUE
|
||||
@@ -431,59 +431,59 @@ rem 24 SPECIAL COLOR 200 200 0 BRIGHT YELLOW
|
||||
rem 25 SPECIAL COLOR 200 200 200 BRIGHT WHITE
|
||||
EOF
|
||||
|
||||
../src/remind -w128 -c ../tests/utf-8.rem 1 Nov 2019 >> ../tests/test.out
|
||||
../src/remind -c ../tests/test-addomit.rem 1 Sep 2021 >> ../tests/test.out
|
||||
../src/remind --flush -w128 -c ../tests/utf-8.rem 1 Nov 2019 >> ../tests/test.out
|
||||
../src/remind --flush -c ../tests/test-addomit.rem 1 Sep 2021 >> ../tests/test.out
|
||||
|
||||
../src/remind -cu ../tests/utf-8.rem 1 Nov 2019 >> ../tests/test.out
|
||||
../src/remind -cu '-i$SuppressLRM=1' ../tests/utf-8.rem 1 Nov 2019 >> ../tests/test.out
|
||||
../src/remind --flush -cu ../tests/utf-8.rem 1 Nov 2019 >> ../tests/test.out
|
||||
../src/remind --flush -cu '-i$SuppressLRM=1' ../tests/utf-8.rem 1 Nov 2019 >> ../tests/test.out
|
||||
|
||||
TZ=America/Toronto ../src/remind -dxe ../tests/tz.rem >> ../tests/test.out 2>&1
|
||||
TZ=Europe/Berlin ../src/remind -dxe ../tests/tz.rem >> ../tests/test.out 2>&1
|
||||
TZ=America/Toronto ../src/remind --flush -dxe ../tests/tz.rem >> ../tests/test.out 2>&1
|
||||
TZ=Europe/Berlin ../src/remind --flush -dxe ../tests/tz.rem >> ../tests/test.out 2>&1
|
||||
|
||||
../src/remind ../tests/soleq.rem 1 April 2044 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush ../tests/soleq.rem 1 April 2044 >> ../tests/test.out 2>&1
|
||||
|
||||
# Test that banner is printed on every iteration
|
||||
echo "MSG Should be three banners." | ../src/remind - 2022-10-20 '*3' >> ../tests/test.out 2>&1
|
||||
echo "MSG Should be three banners." | ../src/remind --flush - 2022-10-20 '*3' >> ../tests/test.out 2>&1
|
||||
|
||||
# Test the -tn option
|
||||
echo "REM May 23 +10 MSG Orange %b" | ../src/remind - 2023-05-21 >> ../tests/test.out 2>&1
|
||||
echo "REM May 23 +10 MSG Quux %b" | ../src/remind -t1 - 2023-05-21 >> ../tests/test.out 2>&1
|
||||
echo "REM May 23 +10 MSG Cabbage %b" | ../src/remind -t2 - 2023-05-21 >> ../tests/test.out 2>&1
|
||||
echo "REM May 23 MSG Banana %b" | ../src/remind - 2023-05-21 >> ../tests/test.out 2>&1
|
||||
echo "REM May 23 MSG Carrot %b" | ../src/remind -t1 - 2023-05-21 >> ../tests/test.out 2>&1
|
||||
echo "REM May 23 MSG Apple %b" | ../src/remind -t2 - 2023-05-21 >> ../tests/test.out 2>&1
|
||||
echo "REM May 23 +10 MSG Orange %b" | ../src/remind --flush - 2023-05-21 >> ../tests/test.out 2>&1
|
||||
echo "REM May 23 +10 MSG Quux %b" | ../src/remind --flush -t1 - 2023-05-21 >> ../tests/test.out 2>&1
|
||||
echo "REM May 23 +10 MSG Cabbage %b" | ../src/remind --flush -t2 - 2023-05-21 >> ../tests/test.out 2>&1
|
||||
echo "REM May 23 MSG Banana %b" | ../src/remind --flush - 2023-05-21 >> ../tests/test.out 2>&1
|
||||
echo "REM May 23 MSG Carrot %b" | ../src/remind --flush -t1 - 2023-05-21 >> ../tests/test.out 2>&1
|
||||
echo "REM May 23 MSG Apple %b" | ../src/remind --flush -t2 - 2023-05-21 >> ../tests/test.out 2>&1
|
||||
|
||||
# Test the -tz option
|
||||
echo "REM May 22 +10 MSG Foo %b" | ../src/remind - 2023-05-21 >> ../tests/test.out 2>&1
|
||||
echo "REM May 22 +10 MSG Bar %b" | ../src/remind -tz - 2023-05-21 >> ../tests/test.out 2>&1
|
||||
echo "REM May 22 +10 MSG Foo %b" | ../src/remind --flush - 2023-05-21 >> ../tests/test.out 2>&1
|
||||
echo "REM May 22 +10 MSG Bar %b" | ../src/remind --flush -tz - 2023-05-21 >> ../tests/test.out 2>&1
|
||||
|
||||
# World-writable file
|
||||
rm -rf include_dir/ww
|
||||
touch include_dir/ww
|
||||
chmod 0666 include_dir/ww
|
||||
../src/remind include_dir/ww >> ../tests/test.out 2>&1
|
||||
../src/remind --flush include_dir/ww >> ../tests/test.out 2>&1
|
||||
rm -rf include_dir/ww
|
||||
|
||||
# World-writable directory
|
||||
mkdir -p include_dir/ww
|
||||
touch include_dir/ww/0.rem
|
||||
chmod 0777 include_dir/ww
|
||||
../src/remind include_dir/ww >> ../tests/test.out 2>&1
|
||||
../src/remind --flush include_dir/ww >> ../tests/test.out 2>&1
|
||||
rm -rf include_dir/ww
|
||||
|
||||
# This segfaulted in 04.02.03
|
||||
../src/remind -h '-imsgprefix(x)="foo"' /dev/null >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -h '-imsgprefix(x)="foo"' /dev/null >> ../tests/test.out 2>&1
|
||||
|
||||
# Test --version long option
|
||||
../src/remind --version >> ../tests/test.out 2>&1
|
||||
../src/remind --flush --version >> ../tests/test.out 2>&1
|
||||
|
||||
# Test queueing. Because eventstart depends on the actual system
|
||||
# date, we use the --test flag to fake the date and time.
|
||||
echo JSONQUEUE | ../src/remind --test -z0 ../tests/queue1.rem >> ../tests/test.out 2>&1
|
||||
echo QUEUE | ../src/remind --test -zj ../tests/queue1.rem >> ../tests/test.out 2>&1
|
||||
echo JSONQUEUE | ../src/remind --flush --test -z0 ../tests/queue1.rem >> ../tests/test.out 2>&1
|
||||
echo QUEUE | ../src/remind --flush --test -zj ../tests/queue1.rem >> ../tests/test.out 2>&1
|
||||
|
||||
# Test for leap year bug that was fixed
|
||||
../src/remind -dte - 28 Feb 2024 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -dte - 28 Feb 2024 <<'EOF' >> ../tests/test.out 2>&1
|
||||
BANNER %
|
||||
REM 29 MSG One
|
||||
REM 29 Feb MSG two
|
||||
@@ -503,7 +503,7 @@ REM Friday 29 2024 MSG three
|
||||
REM Friday 29 Feb 2024 MSG four
|
||||
EOF
|
||||
|
||||
../src/remind -dte - 1 Mar 2024 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -dte - 1 Mar 2024 <<'EOF' >> ../tests/test.out 2>&1
|
||||
BANNER %
|
||||
REM 29 MSG One
|
||||
REM 29 Feb MSG two
|
||||
@@ -523,7 +523,7 @@ REM Friday 29 2024 MSG three
|
||||
REM Friday 29 Feb 2024 MSG four
|
||||
EOF
|
||||
|
||||
../src/remind -dte - 28 Feb 2025 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -dte - 28 Feb 2025 <<'EOF' >> ../tests/test.out 2>&1
|
||||
BANNER %
|
||||
REM 29 MSG One
|
||||
REM 29 Feb MSG two
|
||||
@@ -543,7 +543,7 @@ REM Friday 29 2025 MSG three
|
||||
REM Friday 29 Feb 2025 MSG four
|
||||
EOF
|
||||
|
||||
../src/remind -dte - 1 Mar 2025 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -dte - 1 Mar 2025 <<'EOF' >> ../tests/test.out 2>&1
|
||||
BANNER %
|
||||
REM 29 MSG One
|
||||
REM 29 Feb MSG two
|
||||
@@ -564,21 +564,21 @@ REM Friday 29 Feb 2025 MSG four
|
||||
EOF
|
||||
|
||||
|
||||
(echo 'BANNER %'; echo 'REM 29 MSG No bug') | ../src/remind -dt - 29 Feb 2024 >> ../tests/test.out 2>&1
|
||||
(echo 'BANNER %'; echo 'REM 29 MSG No bug') | ../src/remind --flush -dt - 29 Feb 2024 >> ../tests/test.out 2>&1
|
||||
|
||||
../src/remind -ifoo - <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -ifoo - <<'EOF' >> ../tests/test.out 2>&1
|
||||
BANNER %
|
||||
DUMP
|
||||
EOF
|
||||
|
||||
../src/remind '-i$AddBlankLines' - <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush '-i$AddBlankLines' - <<'EOF' >> ../tests/test.out 2>&1
|
||||
BANNER %
|
||||
DUMP
|
||||
DUMP $AddBlankLines
|
||||
EOF
|
||||
|
||||
../src/remind ../tests/expr.rem >> ../tests/test.out 2>&1
|
||||
../src/remind --flush ../tests/expr.rem >> ../tests/test.out 2>&1
|
||||
|
||||
../src/remind - <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush - <<'EOF' >> ../tests/test.out 2>&1
|
||||
PUSH
|
||||
POP
|
||||
PUSH
|
||||
@@ -594,48 +594,53 @@ PUSH
|
||||
POP
|
||||
EOF
|
||||
|
||||
../src/remind ../tests/if1.rem 2020-03-03 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush ../tests/if1.rem 2020-03-03 >> ../tests/test.out 2>&1
|
||||
|
||||
# Test ONCE with a timestamp file
|
||||
rm -f ../tests/once.timestamp
|
||||
../src/remind ../tests/test-once.rem >> ../tests/test.out 2>&1
|
||||
../src/remind ../tests/test-once.rem >> ../tests/test.out 2>&1
|
||||
../src/remind ../tests/test-once.rem >> ../tests/test.out 2>&1
|
||||
../src/remind --flush ../tests/test-once.rem >> ../tests/test.out 2>&1
|
||||
../src/remind --flush ../tests/test-once.rem >> ../tests/test.out 2>&1
|
||||
../src/remind --flush ../tests/test-once.rem >> ../tests/test.out 2>&1
|
||||
tail -n+2 ../tests/once.timestamp >> ../tests/test.out 2>&1
|
||||
rm -f ../tests/once.timestamp
|
||||
|
||||
../src/remind - < ../tests/test-once.rem >> ../tests/test.out 2>&1
|
||||
../src/remind - < ../tests/test-once.rem >> ../tests/test.out 2>&1
|
||||
../src/remind - < ../tests/test-once.rem >> ../tests/test.out 2>&1
|
||||
../src/remind --flush - < ../tests/test-once.rem >> ../tests/test.out 2>&1
|
||||
../src/remind --flush - < ../tests/test-once.rem >> ../tests/test.out 2>&1
|
||||
../src/remind --flush - < ../tests/test-once.rem >> ../tests/test.out 2>&1
|
||||
tail -n+2 ../tests/once.timestamp >> ../tests/test.out 2>&1
|
||||
rm -f ../tests/once.timestamp
|
||||
|
||||
# Newlines in calendar output
|
||||
(echo 'SET $SuppressLRM 1'; echo 'REM 16 MSG foo%_bar%_baz wookie quux apple %_ %_ %_ blech'; echo "REM 16 MSG ANOTHER") | ../src/remind -c -w80 - 1 sep 1990 >> ../tests/test.out 2>&1
|
||||
(echo 'SET $SuppressLRM 1'; echo 'REM 16 MSG foo%_bar%_baz wookie quux apple %_ %_ %_ blech'; echo "REM 16 MSG ANOTHER") | ../src/remind --flush -c -w80 - 1 sep 1990 >> ../tests/test.out 2>&1
|
||||
|
||||
# Dedupe feature
|
||||
../src/remind -c ../tests/dedupe.rem 1 November 2023 >> ../tests/test.out 2>&1
|
||||
../src/remind -q ../tests/dedupe.rem 8 November 2023 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -c ../tests/dedupe.rem 1 November 2023 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -q ../tests/dedupe.rem 8 November 2023 >> ../tests/test.out 2>&1
|
||||
|
||||
# Remove references to SysInclude, which is build-specific
|
||||
grep -F -v '$SysInclude' < ../tests/test.out > ../tests/test.out.1 && mv -f ../tests/test.out.1 ../tests/test.out
|
||||
|
||||
# If "man" accepts the --warnings flag, test all the man pages.
|
||||
man man | grep -e --warnings > /dev/null 2>&1
|
||||
if test $? = 0 ; then
|
||||
for i in ../man/*.1 ; do
|
||||
man --warnings=w $i 2>>../tests/test.out 1>/dev/null
|
||||
done
|
||||
RUNMAN=0
|
||||
man man 2>&1 | grep -e --warnings > /dev/null 2>&1
|
||||
if test "$?" = 0 ; then
|
||||
RUNMAN=1
|
||||
fi
|
||||
for i in ../man/*.1 ; do
|
||||
echo "Checking $i..." >> ../tests/test.out
|
||||
if test "$RUNMAN" = 1 ; then
|
||||
man --warnings=w $i 2>>../tests/test.out 1>/dev/null
|
||||
fi
|
||||
done
|
||||
|
||||
# Test --print-tokens long option
|
||||
../src/remind --print-tokens < /dev/null >> ../tests/test.out 2>&1
|
||||
../src/remind --flush --print-tokens < /dev/null >> ../tests/test.out 2>&1
|
||||
|
||||
# Torture test #2
|
||||
../src/remind ../tests/torture2.rem >> ../tests/test.out 2>&1
|
||||
../src/remind --flush ../tests/torture2.rem >> ../tests/test.out 2>&1
|
||||
|
||||
# Expression error-reporting
|
||||
../src/remind -de - 1 Feb 2024 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -de - 1 Feb 2024 <<'EOF' >> ../tests/test.out 2>&1
|
||||
set a 8 * "]]]" & 6
|
||||
msg [8 * "]]]" & 6] is weird
|
||||
set a 9 *
|
||||
@@ -643,13 +648,13 @@ set a 9 * ]
|
||||
EOF
|
||||
|
||||
# Translation template generateion
|
||||
../src/remind -h - 1 Feb 2024 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -h - 1 Feb 2024 <<'EOF' >> ../tests/test.out 2>&1
|
||||
TRANSLATE GENERATE
|
||||
EOF
|
||||
|
||||
# Make sure stupidly-long translations of "am" and "pm" can't cause a
|
||||
# segmentation fault
|
||||
../src/remind -c - 1 Feb 2024 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -c - 1 Feb 2024 <<'EOF' >> ../tests/test.out 2>&1
|
||||
TRANS "am" "alsdkjalksdj alksjd alksdj alksjd laksjd laksjd laksjd laksjd laksjd laksjd laksjd laksjd lkasjd laksjd laksjd lkajs dlkajs dlkasj dlkasjd lkajsd lkajs dlkasjd lkasj dlkajsd lkasjd lkasjd laksjd laksjd laksjd alskdj alskdj alksdj alksdj alskdj alksdj aslkdj"
|
||||
TRANS "pm" "oiwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwjwwwwwwwwwwwwwwwjwpqoejkpqwojepqowjepqojwepqowjepqowjepqowjepqowjepqowjepqowjepqojwepqowjepqowjepqowjepqowjepqowjeqpweoj"
|
||||
|
||||
@@ -658,12 +663,12 @@ REM WED AT 13:00 MSG blah
|
||||
EOF
|
||||
|
||||
# The INFO keyword
|
||||
../src/remind -pp - 1 Feb 2024 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -pp - 1 Feb 2024 <<'EOF' >> ../tests/test.out 2>&1
|
||||
REM Wed INFO "Location: here" INFO "Summary: Nope" MSG Meeting [triginfo("location")] %<summary> %<nonexist> [triginfo("cabbage")]
|
||||
EOF
|
||||
|
||||
# Invalid info strings
|
||||
../src/remind - 1 Feb 2024 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush - 1 Feb 2024 <<'EOF' >> ../tests/test.out 2>&1
|
||||
REM Thu INFO "Invalid" MSG wookie
|
||||
REM Fri INFO ": foo" MSG blat
|
||||
REM Sun INFO "foo bar baz : blork" MSG uua
|
||||
@@ -673,7 +678,7 @@ REM Sat INFO "Location: here" INFO "location: there" MSG blort
|
||||
EOF
|
||||
|
||||
# Test parsing of quoted strings and the "escape" function
|
||||
../src/remind - 1 Feb 2024 <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush - 1 Feb 2024 <<'EOF' >> ../tests/test.out 2>&1
|
||||
BANNER %
|
||||
SET $AddBlankLines 0
|
||||
TRANSLATE "foo" "test: \\\" \a\b\f\\n\r\t\v\x3\x1b haha"
|
||||
@@ -703,40 +708,40 @@ set a "\x00P"
|
||||
EOF
|
||||
|
||||
# Test diagnostics when using a timed substitution without an AT clause
|
||||
../src/remind - 1 Feb 2024 1:00 <<EOF >> ../tests/test.out 2>&1
|
||||
../src/remind --flush - 1 Feb 2024 1:00 <<EOF >> ../tests/test.out 2>&1
|
||||
REM MSG %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 hahaha
|
||||
EOF
|
||||
|
||||
# Test translate table dumping
|
||||
../src/remind - 1 Feb 2024 <<EOF >> ../tests/test.out 2>&1
|
||||
../src/remind --flush - 1 Feb 2024 <<EOF >> ../tests/test.out 2>&1
|
||||
TRANSLATE "\x03" "BREAK"
|
||||
TRANSLATE DUMP
|
||||
EOF
|
||||
|
||||
../src/remind -ppp - 1 Feb 2024 <<EOF >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -ppp - 1 Feb 2024 <<EOF >> ../tests/test.out 2>&1
|
||||
TRANSLATE "\x03" "BREAK"
|
||||
EOF
|
||||
|
||||
# SCANFROM should be preserved even if it is today
|
||||
../src/remind -ppp - 1 Feb 2024 <<EOF >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -ppp - 1 Feb 2024 <<EOF >> ../tests/test.out 2>&1
|
||||
REM SCANFROM 2024-02-01 MSG Preserve SCANFROM
|
||||
EOF
|
||||
# Languages
|
||||
for i in ../include/lang/??.rem ; do
|
||||
../src/remind -r -q "-ii=\"$i\"" ../tests/tstlang.rem 1 Feb 2024 13:34 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -r -q "-ii=\"$i\"" ../tests/tstlang.rem 1 Feb 2024 13:34 >> ../tests/test.out 2>&1
|
||||
done
|
||||
|
||||
# Fix for $DefaultColor bug with remind -s
|
||||
../src/remind -s - 1 Feb 2024 >> ../tests/test.out 2>&1 <<'EOF'
|
||||
../src/remind --flush -s - 1 Feb 2024 >> ../tests/test.out 2>&1 <<'EOF'
|
||||
SET $DefaultColor "255 0 0"
|
||||
REM Wed MSG Wookie
|
||||
EOF
|
||||
|
||||
# Test year-folding
|
||||
TZ=America/Toronto ../src/remind -dx ../tests/yearfold.rem >> ../tests/test.out 2>&1
|
||||
TZ=America/Toronto ../src/remind --flush -dx ../tests/yearfold.rem >> ../tests/test.out 2>&1
|
||||
|
||||
# Test unused-variable debugging
|
||||
../src/remind -du - <<'EOF' >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -du - <<'EOF' >> ../tests/test.out 2>&1
|
||||
set a 1
|
||||
set b a*2
|
||||
set c "What"
|
||||
@@ -751,36 +756,36 @@ unset y
|
||||
EOF
|
||||
|
||||
# Test RETURN statement
|
||||
../src/remind ../tests/ret1.rem 4 June 2000 >> ../tests/test.out 2>&1
|
||||
../src/remind ../tests/ret1.rem 5 June 2000 >> ../tests/test.out 2>&1
|
||||
../src/remind ../tests/ret1.rem 7 June 2000 >> ../tests/test.out 2>&1
|
||||
../src/remind -s ../tests/ret1.rem 1 June 2000 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush ../tests/ret1.rem 4 June 2000 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush ../tests/ret1.rem 5 June 2000 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush ../tests/ret1.rem 7 June 2000 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -s ../tests/ret1.rem 1 June 2000 >> ../tests/test.out 2>&1
|
||||
|
||||
# Make sure all the include files are ok
|
||||
find ../include -type f -name '*.rem' | while read x; do ../src/remind -du -n $x 1 Jan 2024 2>>../tests/test.out 1>/dev/null; done
|
||||
find ../include -type f -name '*.rem' | while read x; do ../src/remind --flush -du -n $x 1 Jan 2024 2>>../tests/test.out 1>/dev/null; done
|
||||
|
||||
# Test todos
|
||||
echo "" >> ../tests/test.out 2>&1
|
||||
echo "Testing TODOS in agenda mode" >> ../tests/test.out 2>&1
|
||||
../src/remind ../tests/todos.rem 2025-08-13 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush ../tests/todos.rem 2025-08-13 >> ../tests/test.out 2>&1
|
||||
echo "" >> ../tests/test.out 2>&1
|
||||
echo "Testing TODOS in calendar mode" >> ../tests/test.out 2>&1
|
||||
../src/remind -s ../tests/todos.rem 2025-08-13 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -s ../tests/todos.rem 2025-08-13 >> ../tests/test.out 2>&1
|
||||
echo "" >> ../tests/test.out 2>&1
|
||||
echo "Testing TODOS in calendar mode with completed todos hidden" >> ../tests/test.out 2>&1
|
||||
../src/remind -s --hide-completed-todos ../tests/todos.rem 2025-08-13 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush -s --hide-completed-todos ../tests/todos.rem 2025-08-13 >> ../tests/test.out 2>&1
|
||||
echo "Testing TODOS and JSON mode" >> ../tests/test.out 2>&1
|
||||
../src/remind --json ../tests/todos.rem 2025-08-13 >> ../tests/test.out 2>&1
|
||||
../src/remind --flush --json ../tests/todos.rem 2025-08-13 >> ../tests/test.out 2>&1
|
||||
|
||||
echo "Testing proper redirection of RUN stdout in JSON mode... here's stdout" >> ../tests/test.out 2>&1
|
||||
../src/remind --json ../tests/json-redirect.rem 1 Jan 2025 >> ../tests/test.out 2>/dev/null
|
||||
../src/remind --flush --json ../tests/json-redirect.rem 1 Jan 2025 >> ../tests/test.out 2>/dev/null
|
||||
|
||||
echo "... and here is stderr" >> ../tests/test.out 2>&1
|
||||
../src/remind --json ../tests/json-redirect.rem 1 Jan 2025 > /dev/null 2>> ../tests/test.out
|
||||
../src/remind --flush --json ../tests/json-redirect.rem 1 Jan 2025 > /dev/null 2>> ../tests/test.out
|
||||
|
||||
# Test %: substitution sequence in all the languages
|
||||
for i in ../include/lang/??.rem ; do
|
||||
../src/remind "-ii=\"$i\"" -p - 2025-08-13 <<'EOF' 2>&1 | grep 2025/ >> ../tests/test.out
|
||||
../src/remind --flush "-ii=\"$i\"" -p - 2025-08-13 <<'EOF' 2>&1 | grep 2025/ >> ../tests/test.out
|
||||
DO [i]
|
||||
REM TODO 2025-08-13 MSG %(LANGID) Task1%:
|
||||
REM TODO 2025-08-13 COMPLETE-THROUGH 2025-08-12 MSG %(LANGID) Task2%:
|
||||
@@ -788,6 +793,8 @@ REM TODO 2025-08-13 COMPLETE-THROUGH 2025-08-13 MSG %(LANGID) Task3%:
|
||||
EOF
|
||||
done
|
||||
|
||||
../src/remind --flush -q ../tests/safety.rem 2025-08-13 >> ../tests/test.out 2>&1
|
||||
|
||||
cmp -s ../tests/test.out ../tests/test.cmp
|
||||
if [ "$?" = "0" ]; then
|
||||
echo "Remind: Acceptance test PASSED"
|
||||
|
||||
3965
tests/test.cmp
3965
tests/test.cmp
File diff suppressed because one or more lines are too long
@@ -5,6 +5,9 @@
|
||||
#
|
||||
# ./test-rem # From WITHIN Remind source directory!
|
||||
|
||||
SET $Latitude "45.42055556"
|
||||
SET $Longitude "-75.68944444"
|
||||
|
||||
# Should issue a warning
|
||||
fset year(x) 1
|
||||
|
||||
@@ -977,10 +980,17 @@ set a htmlstriptags("this is > whut <b>foo</b>")
|
||||
set a htmlstriptags("<img src=\"foo\">")
|
||||
|
||||
# $ParseUntriggered
|
||||
|
||||
# Default is 0
|
||||
REM 2 Jan 1990 MSG ["bad_expr" / 2]
|
||||
|
||||
# Set to 1 explicitly
|
||||
SET $ParseUntriggered 1
|
||||
REM 2 Jan 1990 MSG ["bad_expr" / 2]
|
||||
|
||||
# Set to 0 explicitly
|
||||
SET $ParseUntriggered 0
|
||||
REM 2 Jan 1990 MSG ["bad_expr" / 2]
|
||||
SET $ParseUntriggered 1
|
||||
|
||||
# String multiplication
|
||||
|
||||
|
||||
@@ -34,3 +34,5 @@ set a utctolocal('2051-01-01@04:44')
|
||||
set a utctolocal('2050-03-13@05:00')
|
||||
set a utctolocal('2050-11-06@04:00')
|
||||
set a utctolocal('2050-11-06@07:00')
|
||||
|
||||
set a trigger('1990-01-01@1:22', 1)
|
||||
|
||||
Reference in New Issue
Block a user