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/nix/main.cc | 4 +++- src/nix/sigs.cc | 9 +++++++-- src/nix/verify.cc | 9 +++++++-- 3 files changed, 17 insertions(+), 5 deletions(-) (limited to 'src/nix') diff --git a/src/nix/main.cc b/src/nix/main.cc index ea6838cd7..88a602b84 100644 --- a/src/nix/main.cc +++ b/src/nix/main.cc @@ -33,7 +33,9 @@ struct NixArgs : virtual MultiCommand, virtual MixCommonArgs mkFlag(0, "version", "show version information", std::bind(printVersion, programName)); - settings.convertToArgs(*this); + std::string cat = "config"; + settings.convertToArgs(*this, cat); + hiddenCategories.insert(cat); } void printFlags(std::ostream & out) override diff --git a/src/nix/sigs.cc b/src/nix/sigs.cc index 3dd037716..0e3eb9b69 100644 --- a/src/nix/sigs.cc +++ b/src/nix/sigs.cc @@ -13,8 +13,13 @@ struct CmdCopySigs : StorePathsCommand CmdCopySigs() { - mkFlag('s', "substituter", {"store-uri"}, "use signatures from specified store", 1, - [&](Strings ss) { substituterUris.push_back(ss.front()); }); + mkFlag() + .longName("substituter") + .shortName('s') + .labels({"store-uri"}) + .description("use signatures from specified store") + .arity(1) + .handler([&](Strings ss) { substituterUris.push_back(ss.front()); }); } std::string name() override diff --git a/src/nix/verify.cc b/src/nix/verify.cc index 8facb4bef..18533e606 100644 --- a/src/nix/verify.cc +++ b/src/nix/verify.cc @@ -19,8 +19,13 @@ struct CmdVerify : StorePathsCommand { mkFlag(0, "no-contents", "do not verify the contents of each store path", &noContents); mkFlag(0, "no-trust", "do not verify whether each store path is trusted", &noTrust); - mkFlag('s', "substituter", {"store-uri"}, "use signatures from specified store", 1, - [&](Strings ss) { substituterUris.push_back(ss.front()); }); + mkFlag() + .longName("substituter") + .shortName('s') + .labels({"store-uri"}) + .description("use signatures from specified store") + .arity(1) + .handler([&](Strings ss) { substituterUris.push_back(ss.front()); }); mkIntFlag('n', "sigs-needed", "require that each path has at least N valid signatures", &sigsNeeded); } -- cgit v1.2.3