about summary refs log tree commit diff
path: root/src/libmain
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2009-02-27T11·04+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2009-02-27T11·04+0000
commit60cb7de336035768089cc764a3fd7e8867a8d298 (patch)
tree710ab85ccd7aa37f2df21ea5b37011273719273c /src/libmain
parent8ab6bc5a49686aedf85adffe322c4f016764af5f (diff)
* Allow options from the Nix config file to be overriden from the
  command line (e.g. "--option build-use-chroot true").

Diffstat (limited to 'src/libmain')
-rw-r--r--src/libmain/shared.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index cfb34d7eb888..e080d8cc5a8a 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -243,6 +243,13 @@ static void initAndRun(int argc, char * * argv)
             maxSilentTime = getIntArg(arg, i, args.end());
         else if (arg == "--no-build-hook")
             useBuildHook = false;
+        else if (arg == "--option") {
+            ++i; if (i == args.end()) throw UsageError("`--option' requires two arguments");
+            string name = *i;
+            ++i; if (i == args.end()) throw UsageError("`--option' requires two arguments");
+            string value = *i;
+            overrideSetting(name, tokenizeString(value));
+        }
         else remaining.push_back(arg);
     }