diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2006-09-13 16:22:22 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2006-09-13 16:22:22 +0000 |
commit | 6b7608c58fd81a69074bed06330dc08b392f4e3b (patch) | |
tree | 019666a02e422284d5a3f53f4ba3eacc5e7c2989 /src/main.c | |
parent | 9b730905166ca88819ece9e90d8114d9d6cb5fff (diff) | |
download | mailfromd-6b7608c58fd81a69074bed06330dc08b392f4e3b.tar.gz mailfromd-6b7608c58fd81a69074bed06330dc08b392f4e3b.tar.bz2 |
(time_format_string): New global
New option --time-format
git-svn-id: file:///svnroot/mailfromd/trunk@572 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 24 |
1 files changed, 22 insertions, 2 deletions
@@ -97,6 +97,7 @@ double predict_rate; /* Prediction rate for --list --format=rates*/ int ignore_failed_reads_option; /* Ignore failed reads while compacting or expiring */ int all_option; /* Process all databases */ +char *time_format_string = "%c"; /* String to format the time stamps */ #endif int source_info_option; /* Debug messages include source locations */ @@ -1627,6 +1628,7 @@ enum mailfromd_option { OPTION_SHOW_DEFAULTS, OPTION_SOURCE_INFO, OPTION_SYSLOG, + OPTION_TIME_FORMAT, OPTION_TIMEOUT, OPTION_TRACE, OPTION_TRACE_PROGRAM, @@ -1667,7 +1669,7 @@ static struct argp_option options[] = { N_("Ignore failed reads while compacting the database"), GRP+1 }, { "predict", OPTION_PREDICT_NEXT, N_("RATE"), 0, N_("Predict when the user will be able to " - "send next message (use with --list --format=rates)"), GRP+1 }, + "send next message (use with --list --format=rate)"), GRP+1 }, { "lock-retry-count", OPTION_LOCK_RETRY_COUNT, N_("NUMBER"), 0, N_("Set maximum number of attempts to acquire the lock"), GRP+1 }, { "lock-retry-timeout", OPTION_LOCK_RETRY_TIMEOUT, N_("TIME"), 0, @@ -1677,6 +1679,8 @@ static struct argp_option options[] = { { "all", OPTION_ALL, NULL, 0, N_("With --compact or --expire: apply the operation to all " "available databases"), GRP+1 }, + { "time-format", OPTION_TIME_FORMAT, N_("FMT"), 0, + N_("Output timestamps using given format (default \"%c\")"), GRP+1 }, #endif #undef GRP @@ -1752,6 +1756,13 @@ static struct argp_option options[] = { { "source-info", OPTION_SOURCE_INFO, NULL, 0, N_("Debug messages include source information"), GRP+1 }, #undef GRP + +#if 0 +/* This entry is to pacify `make check-docs'. The --log-facility option + is defined in libmailutils. + */ + { "log-facility", } +#endif { NULL } }; @@ -1823,6 +1834,10 @@ parse_opt (int key, char *arg, struct argp_state *state) predict_next_option = 1; mode = MAILFROMD_LIST; break; + + case OPTION_TIME_FORMAT: + time_format_string = arg; + break; #endif case 'L': @@ -1950,7 +1965,7 @@ parse_opt (int key, char *arg, struct argp_state *state) case OPTION_SYSLOG: log_to_stderr = 0; break; - + case OPTION_TIMEOUT: set_option("timeout", arg, 1); break; @@ -2396,6 +2411,7 @@ mailfromd_compact() #endif } +#ifdef USE_DBM static int db_format_enumerator(void *sym, void *data) { @@ -2403,8 +2419,12 @@ db_format_enumerator(void *sym, void *data) printf("%s database: %s\n", fmt->name, fmt->dbname); printf("%s expiration: %lu\n", fmt->name, fmt->expire_interval); + if (strcmp(fmt->name, "cache") == 0) + printf("%s negative expiration: %lu\n", fmt->name, + negative_expire_interval); return 0; } +#endif void mailfromd_show_defaults() |