]> sjero.net Git - wget/blobdiff - src/main.c
Introduce --no-config. The wgetrc files will not be read
[wget] / src / main.c
index 6b71a20d3b7b50060930e5c3dff04121c39472f8..2aa961da8543021d9bd4806def770fb15ca55dc2 100644 (file)
@@ -217,6 +217,7 @@ static struct cmdline_option option_data[] =
     { "http-passwd", 0, OPT_VALUE, "httppassword", -1 }, /* deprecated */
     { "http-password", 0, OPT_VALUE, "httppassword", -1 },
     { "http-user", 0, OPT_VALUE, "httpuser", -1 },
+    { IF_SSL ("https-only"), 0, OPT_BOOLEAN, "httpsonly", -1 },
     { "ignore-case", 0, OPT_BOOLEAN, "ignorecase", -1 },
     { "ignore-length", 0, OPT_BOOLEAN, "ignorelength", -1 },
     { "ignore-tags", 0, OPT_VALUE, "ignoretags", -1 },
@@ -237,6 +238,7 @@ static struct cmdline_option option_data[] =
     { "mirror", 'm', OPT_BOOLEAN, "mirror", -1 },
     { "no", 'n', OPT__NO, NULL, required_argument },
     { "no-clobber", 0, OPT_BOOLEAN, "noclobber", -1 },
+    { "no-config", 0, OPT_BOOLEAN, "noconfig", -1},
     { "no-parent", 0, OPT_BOOLEAN, "noparent", -1 },
     { "output-document", 'O', OPT_VALUE, "outputdocument", -1 },
     { "output-file", 'o', OPT_VALUE, "logfile", -1 },
@@ -472,7 +474,9 @@ Logging and input file:\n"),
   -B,  --base=URL            resolves HTML input-file links (-i -F)\n\
                              relative to URL.\n"),
     N_("\
-       --config=FILE         Specify config file to use.\n"), 
+       --config=FILE         Specify config file to use.\n"),
+    N_("\
+       --no-config           Do not read any config file.\n"),
     "\n",
 
     N_("\
@@ -634,7 +638,9 @@ HTTP options:\n"),
 HTTPS (SSL/TLS) options:\n"),
     N_("\
        --secure-protocol=PR     choose secure protocol, one of auto, SSLv2,\n\
-                                SSLv3, and TLSv1.\n"),
+                                SSLv3, TLSv1 and PFS.\n"),
+    N_("\
+       --https-only             only follow secure HTTPS links\n"),
     N_("\
        --no-check-certificate   don't validate the server's certificate.\n"),
     N_("\
@@ -1042,6 +1048,7 @@ main (int argc, char **argv)
   longindex = -1;
   int retconf;
   bool use_userconfig = false;
+  bool noconfig = false;
 
   while ((retconf = getopt_long (argc, argv,
                                 short_options, long_options, &longindex)) != -1)
@@ -1054,7 +1061,12 @@ main (int argc, char **argv)
         {
           confval = long_options[longindex].val;
           config_opt = &option_data[confval & ~BOOLEAN_NEG_MARKER];
-          if (strcmp (config_opt->long_name, "config") == 0)
+          if (strcmp (config_opt->long_name, "no-config") == 0)
+            {
+              noconfig = true;
+              break;
+            }
+          else if (strcmp (config_opt->long_name, "config") == 0)
             {
               bool userrc_ret = true;
               userrc_ret &= run_wgetrc (optarg);
@@ -1071,7 +1083,7 @@ main (int argc, char **argv)
     }
 
   /* If the user did not specify a config, read the system wgetrc and ~/.wgetrc. */
-  if (use_userconfig == false)
+  if (noconfig == false && use_userconfig == false)
     initialize ();
 
   opterr = 0;