#include <stdio.h>
#include <stdlib.h>
-#include <ctype.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
# include <locale.h>
#endif /* HAVE_LOCALE_H */
#endif /* HAVE_NLS */
+#include <errno.h>
#define OPTIONS_DEFINED_HERE /* for options.h */
makes http_atotm() malfunction. */
#ifdef LC_MESSAGES
setlocale (LC_MESSAGES, "");
+ setlocale (LC_CTYPE, "");
#else
setlocale (LC_ALL, "");
#endif
-i, --input-file=FILE download URLs found in FILE.\n\
-F, --force-html treat input file as HTML.\n\
-B, --base=URL prepends URL to relative links in -F -i file.\n\
+ --sslcertfile=FILE optional client certificate.\n\
+ --sslcertkey=KEYFILE optional keyfile for this certificate.\n\
\n"), _("\
Download:\n\
--bind-address=ADDRESS bind to ADDRESS (hostname or IP) on local host.\n\
-t, --tries=NUMBER set number of retries to NUMBER (0 unlimits).\n\
-O --output-document=FILE write documents to FILE.\n\
-nc, --no-clobber don\'t clobber existing files or use .# suffixes.\n\
- -c, --continue restart getting an existing file.\n\
+ -c, --continue resume getting a partially-downloaded file.\n\
--dot-style=STYLE set retrieval display style.\n\
- -N, --timestamping don\'t retrieve files if older than local.\n\
+ -N, --timestamping don\'t re-retrieve files unless newer than local.\n\
-S, --server-response print server response.\n\
--spider don\'t download anything.\n\
-T, --timeout=SECONDS set the read timeout to SECONDS.\n\
-U, --user-agent=AGENT identify as AGENT instead of Wget/VERSION.\n\
\n"), _("\
FTP options:\n\
- --retr-symlinks when recursing, retrieve linked-to files (not dirs).\n\
- -g, --glob=on/off turn file name globbing on or off.\n\
- --passive-ftp use the \"passive\" transfer mode.\n\
+ -nr, --dont-remove-listing don\'t remove `.listing\' files.\n\
+ -g, --glob=on/off turn file name globbing on or off.\n\
+ --passive-ftp use the \"passive\" transfer mode.\n\
+ --retr-symlinks when recursing, get linked-to files (not dirs).\n\
\n"), _("\
Recursive retrieval:\n\
- -r, --recursive recursive web-suck -- use with care!.\n\
- -l, --level=NUMBER maximum recursion depth (inf or 0 for infinite).\n\
- --delete-after delete files locally after downloading them.\n\
- -k, --convert-links convert non-relative links to relative.\n\
- -K, --backup-converted before converting file X, back up as X.orig.\n\
- -m, --mirror shortcut option equivalent to -r -N -l inf -nr.\n\
- -nr, --dont-remove-listing don\'t remove `.listing\' files.\n\
- -p, --page-requisites get all images, etc. needed to display HTML page.\n\
+ -r, --recursive recursive web-suck -- use with care!\n\
+ -l, --level=NUMBER maximum recursion depth (inf or 0 for infinite).\n\
+ --delete-after delete files locally after downloading them.\n\
+ -k, --convert-links convert non-relative links to relative.\n\
+ -K, --backup-converted before converting file X, back up as X.orig.\n\
+ -m, --mirror shortcut option equivalent to -r -N -l inf -nr.\n\
+ -p, --page-requisites get all images, etc. needed to display HTML page.\n\
\n"), _("\
Recursive accept/reject:\n\
-A, --accept=LIST comma-separated list of accepted extensions.\n\
{ "user-agent", required_argument, NULL, 'U' },
{ "referer", required_argument, NULL, 129 },
{ "use-proxy", required_argument, NULL, 'Y' },
+#ifdef HAVE_SSL
+ { "sslcertfile", required_argument, NULL, 132},
+ { "sslcertkey", required_argument, NULL, 133},
+#endif /* HAVE_SSL */
{ "wait", required_argument, NULL, 'w' },
{ "waitretry", required_argument, NULL, 24 },
{ 0, 0, 0, 0 }
/* [Is the order of the option letters significant? If not, they should be
alphabetized, like the long_options. The only thing I know for sure is
that the options with required arguments must be followed by a ':'.
- -- Dan Harkless <dan-wget@dilvish.speed.net>] */
+ -- Dan Harkless <wget@harkless.org>] */
while ((c = getopt_long (argc, argv, "\
hpVqvdkKsxmNWrHSLcFbEY: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)
case 129:
setval ("referer", optarg);
break;
+#ifdef HAVE_SSL
+ case 132:
+ setval ("sslcertfile", optarg);
+ break;
+ case 133:
+ setval ("sslcertkey", optarg);
+ break;
+#endif /* HAVE_SSL */
case 'A':
setval ("accept", optarg);
break;
opt.dfp = stdout;
else
{
+ struct stat st;
opt.dfp = fopen (opt.output_document, "wb");
if (opt.dfp == NULL)
{
perror (opt.output_document);
exit (1);
}
+ if (fstat (fileno (opt.dfp), &st) == 0 && S_ISREG (st.st_mode))
+ opt.od_known_regular = 1;
}
}
_("Download quota (%s bytes) EXCEEDED!\n"),
legible (opt.quota));
}
- if (opt.convert_links & !opt.delete_after)
+ if (opt.convert_links && !opt.delete_after)
{
convert_all_links ();
}