Add --if-modified-since option

* src/init.c: Add to commands array.
* src/main.c: Add to cmdline_option. Add to help message.
* src/options.h: Add to options struct.
This commit is contained in:
Hubert Tarasiuk 2015-05-05 19:33:02 +02:00 committed by Giuseppe Scrivano
parent be4f91737a
commit 0e8d2d4251
3 changed files with 7 additions and 0 deletions

View File

@ -205,6 +205,7 @@ static const struct {
#endif
{ "httpsproxy", &opt.https_proxy, cmd_string },
{ "httpuser", &opt.http_user, cmd_string },
{ "if-modified-since", &opt.if_modified_since, cmd_boolean },
{ "ignorecase", &opt.ignore_case, cmd_boolean },
{ "ignorelength", &opt.ignore_length, cmd_boolean },
{ "ignoretags", &opt.ignore_tags, cmd_vector },
@ -361,6 +362,7 @@ defaults (void)
opt.no_proxy = sepstring (tmp);
opt.prefer_family = prefer_none;
opt.allow_cache = true;
opt.if_modified_since = true;
opt.read_timeout = 900;
opt.use_robots = true;

View File

@ -301,6 +301,7 @@ static struct cmdline_option option_data[] =
{ "strict-comments", 0, OPT_BOOLEAN, "strictcomments", -1 },
{ "timeout", 'T', OPT_VALUE, "timeout", -1 },
{ "timestamping", 'N', OPT_BOOLEAN, "timestamping", -1 },
{ "if-modified-since", 0, OPT_BOOLEAN, "if-modified-since", -1 },
{ "tries", 't', OPT_VALUE, "tries", -1 },
{ "unlink", 0, OPT_BOOLEAN, "unlink", -1 },
{ "trust-server-names", 0, OPT_BOOLEAN, "trustservernames", -1 },
@ -515,6 +516,9 @@ Download:\n"),
N_("\
-N, --timestamping don't re-retrieve files unless newer than\n\
local\n"),
N_("\
--no-if-modified-since don't use conditional if-modified-since get\n\
requests in timestamping mode\n"),
N_("\
--no-use-server-timestamps don't set the local file's timestamp by\n\
the one on the server\n"),

View File

@ -165,6 +165,7 @@ struct options
#endif
bool timestamping; /* Whether to use time-stamping. */
bool if_modified_since; /* Whether to use conditional get requests. */
bool backup_converted; /* Do we save pre-converted files as *.orig? */
int backups; /* Are numeric backups made? */