]> sjero.net Git - wget/blobdiff - src/main.c
[svn] Commit several minor changes:
[wget] / src / main.c
index 34277c4771405ce94ef622ba3084418bd644319e..8189f644c2d8d8111e803061fdc7680eafca8671 100644 (file)
@@ -49,6 +49,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "retr.h"
 #include "recur.h"
 #include "host.h"
+#include "cookies.h"
 
 #ifndef PATH_SEPARATOR
 # define PATH_SEPARATOR '/'
@@ -101,7 +102,6 @@ i18n_initialize (void)
 
 /* It's kosher to declare these here because their interface _has_ to
    be void foo(void).  */
-void url_init PARAMS ((void));
 void host_init PARAMS ((void));
 
 /* This just calls the various initialization functions from the
@@ -109,7 +109,6 @@ void host_init PARAMS ((void));
 static void
 private_initialize (void)
 {
-  url_init ();
   host_init ();
 }
 \f
@@ -193,6 +192,10 @@ HTTP options:\n\
        --referer=URL         include `Referer: URL\' header in HTTP request.\n\
   -s,  --save-headers        save the HTTP headers to file.\n\
   -U,  --user-agent=AGENT    identify as AGENT instead of Wget/VERSION.\n\
+       --no-http-keep-alive  disable HTTP keep-alive (persistent connections).\n\
+       --cookies=off         don't use cookies.\n\
+       --load-cookies=FILE   load cookies from FILE before session.\n\
+       --save-cookies=FILE   save cookies to FILE after session.\n\
 \n"), stdout);
   fputs (_("\
 FTP options:\n\
@@ -242,13 +245,12 @@ main (int argc, char *const *argv)
   {
     /* Options without arguments: */
     { "background", no_argument, NULL, 'b' },
+    { "backup-converted", no_argument, NULL, 'K' },
     { "continue", no_argument, NULL, 'c' },
     { "convert-links", no_argument, NULL, 'k' },
-    { "backup-converted", no_argument, NULL, 'K' },
     { "debug", no_argument, NULL, 'd' },
     { "delete-after", no_argument, NULL, 136 },
     { "dont-remove-listing", no_argument, NULL, 149 },
-    { "email-address", no_argument, NULL, 154 }, /* undocumented (debug) */
     { "follow-ftp", no_argument, NULL, 142 },
     { "force-directories", no_argument, NULL, 'x' },
     { "force-hier", no_argument, NULL, 'x' }, /* obsolete */
@@ -285,6 +287,7 @@ main (int argc, char *const *argv)
     { "base", required_argument, NULL, 'B' },
     { "bind-address", required_argument, NULL, 155 },
     { "cache", required_argument, NULL, 'C' },
+    { "cookies", required_argument, NULL, 160 },
     { "cut-dirs", required_argument, NULL, 145 },
     { "directory-prefix", required_argument, NULL, 'P' },
     { "domains", required_argument, NULL, 'D' },
@@ -302,6 +305,7 @@ main (int argc, char *const *argv)
     { "include-directories", required_argument, NULL, 'I' },
     { "input-file", required_argument, NULL, 'i' },
     { "level", required_argument, NULL, 'l' },
+    { "load-cookies", required_argument, NULL, 161 },
     { "no", required_argument, NULL, 'n' },
     { "output-document", required_argument, NULL, 'O' },
     { "output-file", required_argument, NULL, 'o' },
@@ -310,6 +314,7 @@ main (int argc, char *const *argv)
     { "proxy-user", required_argument, NULL, 143 },
     { "quota", required_argument, NULL, 'Q' },
     { "reject", required_argument, NULL, 'R' },
+    { "save-cookies", required_argument, NULL, 162 },
     { "timeout", required_argument, NULL, 'T' },
     { "tries", required_argument, NULL, 't' },
     { "user-agent", required_argument, NULL, 'U' },
@@ -395,11 +400,6 @@ hpVqvdkKsxmNWrHSLcFbEY:G:g:T:U:O:l:n:i:o:a:t:D:A:R:P:B:e:Q:X:I:w:C:",
        case 150:
          setval ("simplehostcheck", "on");
          break;
-       case 154:
-         /* For debugging purposes.  */
-         printf ("%s\n", ftp_getaddress ());
-         exit (0);
-         break;
        case 155:
          setval ("bindaddress", optarg);
          break;
@@ -519,6 +519,15 @@ GNU General Public License for more details.\n"));
        case 153:
          setval ("followtags", optarg);
          break;
+       case 160:
+         setval ("cookies", optarg);
+         break;
+       case 161:
+         setval ("loadcookies", optarg);
+         break;
+       case 162:
+         setval ("savecookies", optarg);
+         break;
        case 157:
          setval ("referer", optarg);
          break;
@@ -744,6 +753,7 @@ Can't timestamp and not clobber old files at the same time.\n"));
 
   DEBUGP (("DEBUG output created by Wget %s on %s.\n\n", version_string,
           OS_TYPE));
+
   /* Open the output filename if necessary.  */
   if (opt.output_document)
     {
@@ -831,6 +841,10 @@ Can't timestamp and not clobber old files at the same time.\n"));
                   _("Download quota (%s bytes) EXCEEDED!\n"),
                   legible (opt.quota));
     }
+
+  if (opt.cookies_output)
+    save_cookies (opt.cookies_output);
+
   if (opt.convert_links && !opt.delete_after)
     {
       convert_all_links ();