aboutsummaryrefslogtreecommitdiff
path: root/src/nix/copy.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/copy.cc
parente9f10beed1a30fe80b315a9de4c4c2ab11527db8 (diff)
Flag: Use designated initializers
Diffstat (limited to 'src/nix/copy.cc')
-rw-r--r--src/nix/copy.cc47
1 files changed, 26 insertions, 21 deletions
diff --git a/src/nix/copy.cc b/src/nix/copy.cc
index 85c777d38..77673a1c2 100644
--- a/src/nix/copy.cc
+++ b/src/nix/copy.cc
@@ -19,27 +19,32 @@ struct CmdCopy : StorePathsCommand
CmdCopy()
: StorePathsCommand(true)
{
- mkFlag()
- .longName("from")
- .labels({"store-uri"})
- .description("URI of the source Nix store")
- .dest(&srcUri);
- mkFlag()
- .longName("to")
- .labels({"store-uri"})
- .description("URI of the destination Nix store")
- .dest(&dstUri);
-
- mkFlag()
- .longName("no-check-sigs")
- .description("do not require that paths are signed by trusted keys")
- .set(&checkSigs, NoCheckSigs);
-
- mkFlag()
- .longName("substitute-on-destination")
- .shortName('s')
- .description("whether to try substitutes on the destination store (only supported by SSH)")
- .set(&substitute, Substitute);
+ addFlag({
+ .longName = "from",
+ .description = "URI of the source Nix store",
+ .labels = {"store-uri"},
+ .handler = {&srcUri},
+ });
+
+ addFlag({
+ .longName = "to",
+ .description = "URI of the destination Nix store",
+ .labels = {"store-uri"},
+ .handler = {&dstUri},
+ });
+
+ addFlag({
+ .longName = "no-check-sigs",
+ .description = "do not require that paths are signed by trusted keys",
+ .handler = {&checkSigs, NoCheckSigs},
+ });
+
+ addFlag({
+ .longName = "substitute-on-destination",
+ .shortName = 's',
+ .description = "whether to try substitutes on the destination store (only supported by SSH)",
+ .handler = {&substitute, Substitute},
+ });
}
std::string description() override