aboutsummaryrefslogtreecommitdiff
path: root/src/nix/sigs.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix/sigs.cc')
-rw-r--r--src/nix/sigs.cc31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/nix/sigs.cc b/src/nix/sigs.cc
index 5f07448e0..6c9b9a792 100644
--- a/src/nix/sigs.cc
+++ b/src/nix/sigs.cc
@@ -13,13 +13,13 @@ struct CmdCopySigs : StorePathsCommand
CmdCopySigs()
{
- mkFlag()
- .longName("substituter")
- .shortName('s')
- .labels({"store-uri"})
- .description("use signatures from specified store")
- .arity(1)
- .handler([&](std::vector<std::string> ss) { substituterUris.push_back(ss[0]); });
+ addFlag({
+ .longName = "substituter",
+ .shortName = 's',
+ .description = "use signatures from specified store",
+ .labels = {"store-uri"},
+ .handler = {[&](std::string s) { substituterUris.push_back(s); }},
+ });
}
std::string description() override
@@ -27,6 +27,8 @@ struct CmdCopySigs : StorePathsCommand
return "copy path signatures from substituters (like binary caches)";
}
+ Category category() override { return catUtility; }
+
void run(ref<Store> store, StorePaths storePaths) override
{
if (substituterUris.empty())
@@ -98,12 +100,13 @@ struct CmdSignPaths : StorePathsCommand
CmdSignPaths()
{
- mkFlag()
- .shortName('k')
- .longName("key-file")
- .label("file")
- .description("file containing the secret signing key")
- .dest(&secretKeyFile);
+ addFlag({
+ .longName = "key-file",
+ .shortName = 'k',
+ .description = "file containing the secret signing key",
+ .labels = {"file"},
+ .handler = {&secretKeyFile}
+ });
}
std::string description() override
@@ -111,6 +114,8 @@ struct CmdSignPaths : StorePathsCommand
return "sign the specified paths";
}
+ Category category() override { return catUtility; }
+
void run(ref<Store> store, StorePaths storePaths) override
{
if (secretKeyFile.empty())