X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Fmain.c;fp=src%2Fmain.c;h=2aa961da8543021d9bd4806def770fb15ca55dc2;hp=19d7253d8b4b5d5f974b97f3a94fe84442d075a5;hb=b9e5c3e8b342c2fedfd4465191dfef85132ada58;hpb=87186cbc2f83abfe3d09aa9a9ca1d81af5e24d19 diff --git a/src/main.c b/src/main.c index 19d7253d..2aa961da 100644 --- a/src/main.c +++ b/src/main.c @@ -238,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 }, @@ -473,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_("\ @@ -1045,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) @@ -1057,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); @@ -1074,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;