aboutsummaryrefslogtreecommitdiff
path: root/src/libmain/shared.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-03-07 23:55:55 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-03-07 23:55:55 +0100
commit28bba8c44f484eae38e8a15dcec73cfa999156f6 (patch)
treef5e009a14192dc56a741703d08c622cf7236dc5b /src/libmain/shared.cc
parent8057a192e3254c936fa0bcb5715e09600a28e8f8 (diff)
Prevent config.h from being clobbered
Diffstat (limited to 'src/libmain/shared.cc')
-rw-r--r--src/libmain/shared.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index 4796629dc..e869ef037 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -168,10 +168,11 @@ static void initAndRun(int argc, char * * argv)
remaining.clear();
/* Process default options. */
+ int verbosityDelta = lvlInfo;
for (Strings::iterator i = args.begin(); i != args.end(); ++i) {
string arg = *i;
- if (arg == "--verbose" || arg == "-v") verbosity = (Verbosity) (verbosity + 1);
- else if (arg == "--quiet") verbosity = verbosity > lvlError ? (Verbosity) (verbosity - 1) : lvlError;
+ if (arg == "--verbose" || arg == "-v") verbosityDelta++;
+ else if (arg == "--quiet") verbosityDelta--;
else if (arg == "--log-type") {
string s = getArg(arg, i, args.end());
setLogType(s);
@@ -218,6 +219,8 @@ static void initAndRun(int argc, char * * argv)
else remaining.push_back(arg);
}
+ verbosity = (Verbosity) (verbosityDelta < 0 ? 0 : verbosityDelta);
+
settings.update();
run(remaining);