From 186571965dccf57d15b9f37c1cca92a57187b7b3 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 7 Jun 2017 18:41:20 +0200 Subject: Don't show flags from config settings in "nix --help" --- src/libstore/globals.cc | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/libstore/globals.cc') diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index 3f2bea8e7..2aceed270 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -98,11 +98,23 @@ template<> void BaseSetting::toJSON(JSONPlaceholder & out) AbstractSetting::toJSON(out); } -template<> void BaseSetting::convertToArg(Args & args) +template<> void BaseSetting::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) -- cgit v1.2.3