Commit f9103441 authored by Eric S. Raymond's avatar Eric S. Raymond

Added `logfile' keyword to rc syntax.

svn path=/trunk/; revision=571
parent 570b125f
......@@ -8,6 +8,7 @@ pl 2.0.1 ():
aka list so no potential alias has to be DNS-checked more than once.
* Try to use envelope From. If that fails, fall back on calling-user.
* Added FAQ file
* Added `logfile' keyword to rc syntax.
fetchmail-2.0 (Mon Nov 18 00:32:17 EST 1996):
......
......@@ -49,6 +49,7 @@ char *logfile; /* log file for daemon mode */
int quitmode; /* if --quit was set */
int check_only; /* if --probe was set */
int cmd_batchlimit; /* if --batchlimit was set */
char *cmd_logfile; /* if --logfile was set */
/* miscellaneous global controls */
char *rcfile; /* path name of rc file */
......@@ -594,6 +595,10 @@ static int load_params(int argc, char **argv, int optind)
if (cmd_batchlimit > -1)
batchlimit = cmd_batchlimit;
/* if cmd_logfile was explicitly set, use it to override logfile */
if (cmd_logfile)
logfile = cmd_logfile;
return(implicitmode);
}
......
......@@ -142,6 +142,7 @@ extern char *logfile; /* log file for daemon mode */
extern int quitmode; /* if --quit was set */
extern int check_only; /* if --check was set */
extern int cmd_batchlimit; /* if --batchlimit was set */
extern char *cmd_logfile; /* if --logfile was set */
/* these get computed */
extern int batchlimit; /* if --batchlimit was set */
......
......@@ -519,10 +519,11 @@ or reverse it by saying `user esr here is eric there'
.PP
For backward compatibility, the word `server' is a syninym for `poll'.
.PP
There is currently only one valid global option statement; it is
There are currently two valid global option statements;
\&`set batchlimit = ' followed by a number and sets the same global
specified by the --batchlimit option. (The command line option
can override this.)
specified by the --batchlimit option, and `set logfile = ' followed
by a string sets the same global specified by --logfile. In both
cases, a command-line option will override.
.PP
Basic format is:
......
......@@ -141,7 +141,7 @@ struct query *ctl; /* option record to be initialized */
break;
case 'L':
case LA_LOGFILE:
logfile = optarg;
cmd_logfile = optarg;
break;
case 'f':
case LA_RCFILE:
......
......@@ -21,6 +21,7 @@ int prc_lineno = 1;
set { return SET; }
batchlimit { return BATCHLIMIT; }
logfile { return LOGFILE; }
defaults { return DEFAULTS; }
server { return POLL; }
poll { return POLL; }
......
......@@ -43,7 +43,7 @@ static void prc_reset();
%token DEFAULTS POLL SKIP AKA PROTOCOL AUTHENTICATE TIMEOUT KPOP KERBEROS
%token USERNAME PASSWORD FOLDER SMTPHOST MDA IS HERE THERE TO MAP LIMIT
%token SET BATCHLIMIT
%token SET BATCHLIMIT LOGFILE
%token <proto> PROTO
%token <sval> STRING
%token <number> NUMBER
......@@ -65,6 +65,7 @@ statement_list : statement
/* future global options should also have the form SET <name> <value> */
statement : SET BATCHLIMIT MAP NUMBER {batchlimit = $4;}
| SET LOGFILE STRING {logfile = xstrdup($3);}
/*
* The way the next two productions are written depends on the fact that
......
......@@ -56,6 +56,7 @@
# Legal global option statements are
#
# set batchlimit = -- must be followed by a number
# set logfile = -- must be followed by a string
#
# The noise keywords `and', `with', `has', `wants', and `options' are ignored
# anywhere in an entry; they can be used to make it resemble English. The
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment