From 7ecf65c2618758e011af52b63434f105564e34da Mon Sep 17 00:00:00 2001 From: Hubert Tarasiuk Date: Tue, 5 May 2015 19:33:02 +0200 Subject: [PATCH 4/6] Add --condget 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. --- src/init.c | 1 + src/main.c | 3 +++ src/options.h | 1 + 3 files changed, 5 insertions(+) diff --git a/src/init.c b/src/init.c index 33888de..f3a1c4a 100644 --- a/src/init.c +++ b/src/init.c @@ -155,6 +155,7 @@ static const struct { { "checkcertificate", &opt.check_cert, cmd_boolean }, #endif { "chooseconfig", &opt.choose_config, cmd_file }, + { "condget", &opt.cond_get, cmd_boolean }, { "connecttimeout", &opt.connect_timeout, cmd_time }, { "contentdisposition", &opt.content_disposition, cmd_boolean }, { "contentonerror", &opt.content_on_error, cmd_boolean }, diff --git a/src/main.c b/src/main.c index b59fcab..68927e2 100644 --- a/src/main.c +++ b/src/main.c @@ -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 }, + { "condget", 0, OPT_BOOLEAN, "condget", -1 }, { "tries", 't', OPT_VALUE, "tries", -1 }, { "unlink", 0, OPT_BOOLEAN, "unlink", -1 }, { "trust-server-names", 0, OPT_BOOLEAN, "trustservernames", -1 }, @@ -516,6 +517,8 @@ Download:\n"), -N, --timestamping don't re-retrieve files unless newer than\n\ local\n"), N_("\ + --condget use conditional get 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"), N_("\ diff --git a/src/options.h b/src/options.h index bded0c4..6cd3640 100644 --- a/src/options.h +++ b/src/options.h @@ -165,6 +165,7 @@ struct options #endif bool timestamping; /* Whether to use time-stamping. */ + bool cond_get; /* Whether to use conditional get requests */ bool backup_converted; /* Do we save pre-converted files as *.orig? */ int backups; /* Are numeric backups made? */ -- 2.4.0