X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Finit.c;h=686cac9692f7b7ad97a31bc793a4acdb6275f15a;hp=c81a67bc2cda05d4382b8e2b0a5e1fc9a7abbdff;hb=0a41b946d40e5504d0185c57a35596a50a83575e;hpb=7c431e235c54cf3f5809e35ee7d2bcfa788d7b47 diff --git a/src/init.c b/src/init.c index c81a67bc..686cac96 100644 --- a/src/init.c +++ b/src/init.c @@ -89,6 +89,7 @@ CMD_DECLARE (cmd_spec_secure_protocol); #endif CMD_DECLARE (cmd_spec_timeout); CMD_DECLARE (cmd_spec_useragent); +CMD_DECLARE (cmd_spec_verbose); /* List of recognized commands, each consisting of name, place and function. When adding a new command, simply add it to the list, @@ -230,7 +231,7 @@ static struct { { "useproxy", &opt.use_proxy, cmd_boolean }, { "user", &opt.user, cmd_string }, { "useragent", NULL, cmd_spec_useragent }, - { "verbose", &opt.verbose, cmd_boolean }, + { "verbose", NULL, cmd_spec_verbose }, { "wait", &opt.wait, cmd_time }, { "waitretry", &opt.waitretry, cmd_time } }; @@ -1254,6 +1255,22 @@ cmd_spec_useragent (const char *com, const char *val, void *place_ignored) opt.useragent = xstrdup (val); return true; } + +/* The "verbose" option cannot be cmd_boolean because the variable is + not bool -- it's of type int (-1 means uninitialized because of + some random hackery for disallowing -q -v). */ + +static bool +cmd_spec_verbose (const char *com, const char *val, void *place_ignored) +{ + bool flag; + if (cmd_boolean (com, val, &flag)) + { + opt.verbose = flag; + return true; + } + return false; +} /* Miscellaneous useful routines. */