--spider don\'t download anything.\n\
-T, --timeout=SECONDS set the read timeout to SECONDS.\n\
-w, --wait=SECONDS wait SECONDS between retrievals.\n\
+ --waitretry=SECONDS wait 0..max SECONDS between retries of a retrieval.\n\
-Y, --proxy=on/off turn proxy on or off.\n\
-Q, --quota=NUMBER set retrieval quota to NUMBER.\n\
\n"), _("\
-nr, --dont-remove-listing don\'t remove `.listing\' files.\n\
\n"), _("\
Recursive accept/reject:\n\
- -A, --accept=LIST list of accepted extensions.\n\
- -R, --reject=LIST list of rejected extensions.\n\
- -D, --domains=LIST list of accepted domains.\n\
+ -A, --accept=LIST comma-separated list of accepted extensions.\n\
+ -R, --reject=LIST comma-separated list of rejected extensions.\n\
+ -D, --domains=LIST comma-separated list of accepted domains.\n\
--exclude-domains=LIST comma-separated list of rejected domains.\n\
- -L, --relative follow relative links only.\n\
--follow-ftp follow FTP links from HTML documents.\n\
+ --follow-tags=LIST comma-separated list of followed HTML tags.\n\
+ -G, --ignore-tags=LIST comma-separated list of ignored HTML tags.\n\
-H, --span-hosts go to foreign hosts when recursive.\n\
+ -L, --relative follow relative links only.\n\
-I, --include-directories=LIST list of allowed directories.\n\
-X, --exclude-directories=LIST list of excluded directories.\n\
-nh, --no-host-lookup don\'t DNS-lookup hosts.\n\
{
char **url, **t;
int i, c, nurl, status, append_to_log;
+ int wr = 0;
static struct option long_options[] =
{
+ /* Options without arguments: */
{ "background", no_argument, NULL, 'b' },
{ "continue", no_argument, NULL, 'c' },
{ "convert-links", no_argument, NULL, 'k' },
{ "verbose", no_argument, NULL, 'v' },
{ "version", no_argument, NULL, 'V' },
+ /* Options accepting an argument: */
{ "accept", required_argument, NULL, 'A' },
{ "append-output", required_argument, NULL, 'a' },
{ "backups", required_argument, NULL, 23 }, /* undocumented */
{ "execute", required_argument, NULL, 'e' },
{ "exclude-directories", required_argument, NULL, 'X' },
{ "exclude-domains", required_argument, NULL, 12 },
+ { "follow-tags", required_argument, NULL, 25 },
{ "glob", required_argument, NULL, 'g' },
{ "header", required_argument, NULL, 3 },
{ "htmlify", required_argument, NULL, 7 },
{ "http-passwd", required_argument, NULL, 2 },
{ "http-user", required_argument, NULL, 1 },
+ { "ignore-tags", required_argument, NULL, 'G' },
{ "include-directories", required_argument, NULL, 'I' },
{ "input-file", required_argument, NULL, 'i' },
{ "level", required_argument, NULL, 'l' },
{ "timeout", required_argument, NULL, 'T' },
{ "tries", required_argument, NULL, 't' },
{ "user-agent", required_argument, NULL, 'U' },
+ { "referer", required_argument, NULL, 129 }, /* undocumented */
{ "use-proxy", required_argument, NULL, 'Y' },
{ "wait", required_argument, NULL, 'w' },
+ { "waitretry", required_argument, NULL, 24 }, /* partially undocumented */
{ 0, 0, 0, 0 }
};
initialize ();
while ((c = getopt_long (argc, argv, "\
-hVqvdkKsxmNWrHSLcFbEY:g:T:U:O:l:n:i:o:a:t:D:A:R:P:B:e:Q:X:I:w:",
+hVqvdkKsxmNWrHSLcFbEY:G:g:T:U:O:l:n:i:o:a:t:D:A:R:P:B:e:Q:X:I:w:",
long_options, (int *)0)) != EOF)
{
switch (c)
#endif
exit (0);
break;
- case 'k':
- setval ("convertlinks", "on");
- break;
case 'K':
setval ("backupconverted", "on");
break;
+ case 'k':
+ setval ("convertlinks", "on");
+ break;
case 'L':
setval ("relativeonly", "on");
break;
case 23:
setval ("backups", optarg);
break;
+ case 24:
+ setval ("waitretry", optarg);
+ wr = 1;
+ break;
+ case 25:
+ setval ("followtags", optarg);
+ break;
+ case 129:
+ setval ("referer", optarg);
+ break;
case 'A':
setval ("accept", optarg);
break;
free (val);
}
break;
+ case 'G':
+ setval ("ignoretags", optarg);
+ break;
case 'g':
setval ("glob", optarg);
break;
if (opt.verbose == -1)
opt.verbose = !opt.quiet;
+ /* Retain compatibility with previous scripts.
+ if wait has been set, but waitretry has not, give it the wait value.
+ A simple check on the values is not enough, I could have set
+ wait to n>0 and waitretry to 0 - HEH */
+ if (opt.wait && !wr)
+ {
+ char opt_wait_str[256]; /* bigger than needed buf to prevent overflow */
+
+ sprintf(opt_wait_str, "%ld", opt.wait);
+ setval ("waitretry", opt_wait_str);
+ }
+
/* Sanity checks. */
if (opt.verbose && opt.quiet)
{