diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-05-05 18:59:33 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-05-05 18:59:33 +0200 |
commit | 6f3244ce4517cc51ef3ffd39025152aa7046ef69 (patch) | |
tree | 588f8deb7406821d2d1157c310e15adde4001a61 /src/nix/copy.cc | |
parent | 941f95284ab57e9baa317791327cf1715d8564b5 (diff) | |
parent | 909b4a882057a92ae8b40b8afdab3c4ac30da915 (diff) |
Merge remote-tracking branch 'origin/master' into flakes
Diffstat (limited to 'src/nix/copy.cc')
-rw-r--r-- | src/nix/copy.cc | 49 |
1 files changed, 28 insertions, 21 deletions
diff --git a/src/nix/copy.cc b/src/nix/copy.cc index 23323a36e..a29adf57d 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}, + }); realiseMode = Build; } @@ -77,6 +82,8 @@ struct CmdCopy : StorePathsCommand }; } + Category category() override { return catSecondary; } + ref<Store> createStore() override { return srcUri.empty() ? StoreCommand::createStore() : openStore(srcUri); |