N_("\
-k, --convert-links make links in downloaded HTML or CSS point to\n\
local files.\n"),
+ N_("\
+ --backups=N before writing file X, rotate up to N backup files.\n"),
+
#ifdef __VMS
N_("\
-K, --backup-converted before converting file X, back up as X_orig.\n"),
if (opt.verbose == -1)
opt.verbose = !opt.quiet;
- if (opt.post_data || opt.post_file_name)
- {
- setoptval ("method", "POST", "method");
- if (opt.post_data)
- {
- setoptval ("bodydata", opt.post_data, "body-data");
- opt.post_data = NULL;
- }
- else
- {
- setoptval ("bodyfile", opt.post_file_name, "body-file");
- opt.post_file_name = NULL;
- }
- }
/* Sanity checks. */
if (opt.verbose && opt.quiet)
}
}
+ /* Set various options as required for opt.method. */
+
+ /* When user specifies HEAD as the method, we do not wish to download any
+ files. Hence, set wget to run in spider mode. */
+ if (opt.method && strcasecmp (opt.method, "HEAD") == 0)
+ setoptval ("spider", "1", "spider");
+
+ /* Convert post_data to body-data and post_file_name to body-file options.
+ This is required so as to remove redundant code later on in gethttp().
+ The --post-data and --post-file options may also be removed in
+ the future hence it makes sense to convert them to aliases for
+ the more generic --method options.
+ This MUST occur only after the sanity checks so as to prevent the
+ user from setting both post and body options simultaneously.
+ */
+ if (opt.post_data || opt.post_file_name)
+ {
+ setoptval ("method", "POST", "method");
+ if (opt.post_data)
+ {
+ setoptval ("bodydata", opt.post_data, "body-data");
+ opt.post_data = NULL;
+ }
+ else
+ {
+ setoptval ("bodyfile", opt.post_file_name, "body-file");
+ opt.post_file_name = NULL;
+ }
+ }
+
#ifdef ENABLE_IRI
if (opt.enable_iri)
{