]> sjero.net Git - wget/blobdiff - src/main.c
[svn] Use the passive FTP transfer mode by default.
[wget] / src / main.c
index 6391ebf2cbd34ad3483d1c87d5b7ff774ac84f3c..eb04478323065848144e0bf40f49f4adce176f55 100644 (file)
@@ -1,5 +1,5 @@
 /* Command line parsing.
-   Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Wget.
 
@@ -145,7 +145,7 @@ struct cmdline_option {
     OPT__NO,
     OPT__PARENT,
   } type;
-  void *data;                  /* for standard options */
+  const void *data;            /* for standard options */
   int argtype;                 /* for non-standard options */
 };
 
@@ -182,6 +182,7 @@ struct cmdline_option option_data[] =
     { "follow-tags", 0, OPT_VALUE, "followtags", -1 },
     { "force-directories", 'x', OPT_BOOLEAN, "dirstruct", -1 },
     { "force-html", 'F', OPT_BOOLEAN, "forcehtml", -1 },
+    { "ftp-passwd", 0, OPT_VALUE, "ftppasswd", -1 },
     { "glob", 0, OPT_BOOLEAN, "glob", -1 },
     { "header", 0, OPT_VALUE, "header", -1 },
     { "help", 'h', OPT_FUNCALL, (void *)print_help, no_argument },
@@ -554,7 +555,7 @@ FTP options:\n"),
     N_("\
        --no-glob               turn off FTP file name globbing.\n"),
     N_("\
-       --passive-ftp           use the \"passive\" transfer mode.\n"),
+       --no-passive-ftp        disable the \"passive\" transfer mode.\n"),
     N_("\
        --retr-symlinks         when recursing, get linked-to files (not dir).\n"),
     N_("\
@@ -621,9 +622,6 @@ Recursive accept/reject:\n"),
   for (i = 0; i < countof (help); i++)
     fputs (_(help[i]), stdout);
 
-#ifdef WINDOWS
-  ws_help (exec_name);
-#endif
   exit (0);
 }
 
@@ -632,7 +630,7 @@ print_version (void)
 {
   printf ("GNU Wget %s\n\n", version_string);
   fputs (_("\
-Copyright (C) 2003 Free Software Foundation, Inc.\n"), stdout);
+Copyright (C) 2005 Free Software Foundation, Inc.\n"), stdout);
   fputs (_("\
 This program is distributed in the hope that it will be useful,\n\
 but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
@@ -661,7 +659,8 @@ main (int argc, char *const *argv)
     ++exec_name;
 
 #ifdef WINDOWS
-  windows_main_junk (&argc, (char **) argv, (char **) &exec_name);
+  /* Drop extension (typically .EXE) from executable filename. */
+  windows_main (&argc, (char **) argv, (char **) &exec_name);
 #endif
 
   /* Set option defaults; read the system wgetrc and ~/.wgetrc.  */
@@ -713,7 +712,7 @@ main (int argc, char *const *argv)
          break;
        case OPT_FUNCALL:
          {
-           void (*func) PARAMS ((void)) = opt->data;
+           void (*func) PARAMS ((void)) = (void (*) PARAMS ((void))) opt->data;
            func ();
          }
          break;
@@ -855,12 +854,6 @@ Can't timestamp and not clobber old files at the same time.\n"));
     }
   url[i] = NULL;
 
-  /* Change the title of console window on Windows.  #### I think this
-     statement should belong to retrieve_url().  --hniksic.  */
-#ifdef WINDOWS
-  ws_changetitle (*url, nurl);
-#endif
-
   /* Initialize logging.  */
   log_init (opt.lfilename, append_to_log);
 
@@ -877,7 +870,7 @@ Can't timestamp and not clobber old files at the same time.\n"));
        output_stream = stdout;
       else
        {
-         struct stat st;
+         struct_stat st;
          output_stream = fopen (opt.output_document,
                                 opt.always_rest ? "ab" : "wb");
          if (output_stream == NULL)
@@ -992,9 +985,9 @@ Can't timestamp and not clobber old files at the same time.\n"));
 static RETSIGTYPE
 redirect_output_signal (int sig)
 {
-  char *signal_name = (sig == SIGHUP ? "SIGHUP" :
-                      (sig == SIGUSR1 ? "SIGUSR1" :
-                       "WTF?!"));
+  const char *signal_name = (sig == SIGHUP ? "SIGHUP" :
+                            (sig == SIGUSR1 ? "SIGUSR1" :
+                             "WTF?!"));
   log_request_redirect_output (signal_name);
   progress_schedule_redirect ();
   signal (sig, redirect_output_signal);