aboutsummaryrefslogtreecommitdiff
path: root/src/nix/sigs.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-05-04 22:40:19 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-05-04 22:40:19 +0200
commita721a0b1140bf489d645f5d85737acafc1c57c65 (patch)
treef4b7df80fccc95b46fd3e8419375b563b466cfa4 /src/nix/sigs.cc
parente9f10beed1a30fe80b315a9de4c4c2ab11527db8 (diff)
Flag: Use designated initializers
Diffstat (limited to 'src/nix/sigs.cc')
-rw-r--r--src/nix/sigs.cc27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/nix/sigs.cc b/src/nix/sigs.cc
index 5f07448e0..a91465c2a 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
@@ -98,12 +98,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