/* Command line parsing.
- Copyright (C) 1996-2006 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+ 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
This file is part of GNU Wget.
const char *exec_name;
\f
+#ifndef TESTING
/* Initialize I18N/L10N. That amounts to invoking setlocale, and
setting up gettext's message catalog using bindtextdomain and
textdomain. Does nothing if NLS is disabled or missing. */
{ "level", 'l', OPT_VALUE, "reclevel", -1 },
{ "limit-rate", 0, OPT_VALUE, "limitrate", -1 },
{ "load-cookies", 0, OPT_VALUE, "loadcookies", -1 },
+ { "max-redirect", 0, OPT_VALUE, "maxredirect", -1 },
{ "mirror", 'm', OPT_BOOLEAN, "mirror", -1 },
{ "no", 'n', OPT__NO, NULL, required_argument },
{ "no-clobber", 0, OPT_BOOLEAN, "noclobber", -1 },
{ "version", 'V', OPT_FUNCALL, (void *) print_version, no_argument },
{ "wait", 'w', OPT_VALUE, "wait", -1 },
{ "waitretry", 0, OPT_VALUE, "waitretry", -1 },
+#ifdef MSDOS
+ { "wdebug", 0, OPT_BOOLEAN, "wdebug", -1 },
+#endif
};
#undef WHEN_DEBUG
#ifdef ENABLE_DEBUG
N_("\
-d, --debug print lots of debugging information.\n"),
+#endif
+#ifdef MSDOS
+ N_("\
+ --wdebug print Watt-32 debug output.\n"),
#endif
N_("\
-q, --quiet quiet (no output).\n"),
--ignore-length ignore `Content-Length' header field.\n"),
N_("\
--header=STRING insert STRING among the headers.\n"),
+ N_("\
+ --max-redirect maximum redirections allowed per page.\n"),
N_("\
--proxy-user=USER set USER as proxy username.\n"),
N_("\
fputs (_("\
Copyright (C) 2007 Free Software Foundation, Inc.\n"), stdout);
fputs (_("\
-License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n\
+License GPLv3+: GNU GPL version 3 or later\n\
+<http://www.gnu.org/licenses/gpl.html>.\n\
This is free software: you are free to change and redistribute it.\n\
-There is NO WARRANTY, to the extent permitted by law.\n", stdout);
+There is NO WARRANTY, to the extent permitted by law.\n"), stdout);
fputs (_("\nOriginally written by Hrvoje Niksic <hniksic@xemacs.org>.\n"),
stdout);
fputs (_("Currently maintained by Micah Cowan <micah@cowan.name>.\n"),
exit (0);
}
\f
-#ifndef TESTING
+
int
main (int argc, char *const *argv)
{
#ifdef WINDOWS
/* Drop extension (typically .EXE) from executable filename. */
- windows_main (&argc, (char **) argv, (char **) &exec_name);
+ windows_main ((char **) &exec_name);
#endif
/* Set option defaults; read the system wgetrc and ~/.wgetrc. */
exit (1);
}
+#ifdef MSDOS
+ if (opt.wdebug)
+ dbug_init();
+ sock_init();
+#else
if (opt.background)
fork_to_background ();
+#endif
/* Initialize progress. Have to do this after the options are
processed so we know where the log file is. */
{
logprintf (LOG_NOTQUIET,
_("FINISHED --%s--\nDownloaded: %d files, %s in %s (%s)\n"),
- time_str (time (NULL)),
+ datetime_str (time (NULL)),
opt.numurls,
human_readable (total_downloaded_bytes),
secs_to_human_time (total_download_time),