about summary refs log tree commit diff
path: root/src/libmain/shared.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-08-30T14·53+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-08-30T14·53+0000
commit80e722278ca03bf303961e2f27487dc98d042803 (patch)
tree2388ec8b32f76de20353c713f2fe580a5aab5b08 /src/libmain/shared.cc
parent20acd43c25a388f5c31c2ee601f1cac88cf12f7b (diff)
* When using the build hook, distinguish between the stderr of the
  hook script proper, and the stdout/stderr of the builder.  Only the
  latter should be saved in /nix/var/log/nix/drvs.
* Allow the verbosity to be set through an option.
* Added a flag --quiet to lower the verbosity level.

Diffstat (limited to 'src/libmain/shared.cc')
-rw-r--r--src/libmain/shared.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index eddc4e64b3d7..f58def403e82 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -196,17 +196,16 @@ static void initAndRun(int argc, char * * argv)
     remaining.clear();
 
     /* Process default options. */
+    int verbosityDelta = 0;
     for (Strings::iterator i = args.begin(); i != args.end(); ++i) {
         string arg = *i;
-        if (arg == "--verbose" || arg == "-v")
-            verbosity = (Verbosity) ((int) verbosity + 1);
+        if (arg == "--verbose" || arg == "-v") verbosityDelta++;
+        else if (arg == "--quiet") verbosityDelta--;
         else if (arg == "--log-type") {
             ++i;
             if (i == args.end()) throw UsageError("`--log-type' requires an argument");
             setLogType(*i);
         }
-        else if (arg == "--build-output" || arg == "-B")
-            ; /* !!! obsolete - remove eventually */
         else if (arg == "--no-build-output" || arg == "-Q")
             buildVerbosity = lvlVomit;
         else if (arg == "--print-build-trace")
@@ -247,6 +246,9 @@ static void initAndRun(int argc, char * * argv)
         else remaining.push_back(arg);
     }
 
+    verbosityDelta += queryIntSetting("verbosity", lvlInfo);
+    verbosity = (Verbosity) (verbosityDelta < 0 ? 0 : verbosityDelta);
+    
     /* Automatically clean up the temporary roots file when we
        exit. */
     RemoveTempRoots removeTempRoots __attribute__((unused));