about summary refs log tree commit diff
path: root/src/libstore/globals.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-06-07T16·41+0200
committerEelco Dolstra <edolstra@gmail.com>2017-06-07T16·41+0200
commit186571965dccf57d15b9f37c1cca92a57187b7b3 (patch)
tree79c38bc54d9a3e2bbd296a094ca988c13088fb09 /src/libstore/globals.cc
parentaa952d5f0bc623a1584f2d589209f586e594c75f (diff)
Don't show flags from config settings in "nix --help"
Diffstat (limited to 'src/libstore/globals.cc')
-rw-r--r--src/libstore/globals.cc20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc
index 3f2bea8e7b13..2aceed27051d 100644
--- a/src/libstore/globals.cc
+++ b/src/libstore/globals.cc
@@ -98,11 +98,23 @@ template<> void BaseSetting<SandboxMode>::toJSON(JSONPlaceholder & out)
     AbstractSetting::toJSON(out);
 }
 
-template<> void BaseSetting<SandboxMode>::convertToArg(Args & args)
+template<> void BaseSetting<SandboxMode>::convertToArg(Args & args, const std::string & category)
 {
-    args.mkFlag(0, name, {}, "Enable sandboxing.", 0, [=](Strings ss) { value = smEnabled; });
-    args.mkFlag(0, "no-" + name, {}, "Disable sandboxing.", 0, [=](Strings ss) { value = smDisabled; });
-    args.mkFlag(0, "relaxed-" + name, {}, "Enable sandboxing, but allow builds to disable it.", 0, [=](Strings ss) { value = smRelaxed; });
+    args.mkFlag()
+        .longName(name)
+        .description("Enable sandboxing.")
+        .handler([=](Strings ss) { value = smEnabled; })
+        .category(category);
+    args.mkFlag()
+        .longName("no-" + name)
+        .description("Disable sandboxing.")
+        .handler([=](Strings ss) { value = smDisabled; })
+        .category(category);
+    args.mkFlag()
+        .longName("relaxed-" + name)
+        .description("Enable sandboxing, but allow builds to disable it.")
+        .handler([=](Strings ss) { value = smRelaxed; })
+        .category(category);
 }
 
 void MaxBuildJobsSetting::set(const std::string & str)