diff options
author | Vincent Ambo <tazjin@google.com> | 2020-05-19T19·47+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-05-19T19·51+0100 |
commit | 39087321811e81e26a1a47d6967df1088dcf0e95 (patch) | |
tree | 57110be423eeb7869e9960466f4b17c0ea7cd961 /third_party/nix/src/nix-copy-closure/nix-copy-closure.cc | |
parent | cf40d08908ede4061eb15513b770c98877844b8b (diff) |
style(3p/nix): Final act in the brace-wrapping saga r/777
This last change set was generated by a full clang-tidy run (including compilation): clang-tidy -p ~/projects/nix-build/ \ -checks=-*,readability-braces-around-statements -fix src/*/*.cc Actually running clang-tidy requires some massaging to make it play nice with Nix + meson, I'll be adding a wrapper or something for that soon.
Diffstat (limited to 'third_party/nix/src/nix-copy-closure/nix-copy-closure.cc')
-rw-r--r-- | third_party/nix/src/nix-copy-closure/nix-copy-closure.cc | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/third_party/nix/src/nix-copy-closure/nix-copy-closure.cc b/third_party/nix/src/nix-copy-closure/nix-copy-closure.cc index 2ec6a021368b..67765a8cf72c 100644 --- a/third_party/nix/src/nix-copy-closure/nix-copy-closure.cc +++ b/third_party/nix/src/nix-copy-closure/nix-copy-closure.cc @@ -18,32 +18,33 @@ static int _main(int argc, char** argv) { parseCmdLine( argc, argv, [&](Strings::iterator& arg, const Strings::iterator& end) { - if (*arg == "--help") + if (*arg == "--help") { showManPage("nix-copy-closure"); - else if (*arg == "--version") + } else if (*arg == "--version") { printVersion("nix-copy-closure"); - else if (*arg == "--gzip" || *arg == "--bzip2" || *arg == "--xz") { + } else if (*arg == "--gzip" || *arg == "--bzip2" || *arg == "--xz") { if (*arg != "--gzip") { LOG(WARNING) << "'" << *arg << "' is not implemented, falling back to gzip"; } gzip = true; - } else if (*arg == "--from") + } else if (*arg == "--from") { toMode = false; - else if (*arg == "--to") + } else if (*arg == "--to") { toMode = true; - else if (*arg == "--include-outputs") + } else if (*arg == "--include-outputs") { includeOutputs = true; - else if (*arg == "--show-progress") + } else if (*arg == "--show-progress") { LOG(WARNING) << "'--show-progress' is not implemented"; - else if (*arg == "--dry-run") + } else if (*arg == "--dry-run") { dryRun = true; - else if (*arg == "--use-substitutes" || *arg == "-s") + } else if (*arg == "--use-substitutes" || *arg == "-s") { useSubstitutes = Substitute; - else if (sshHost.empty()) + } else if (sshHost.empty()) { sshHost = *arg; - else + } else { storePaths.insert(*arg); + } return true; }); @@ -58,8 +59,9 @@ static int _main(int argc, char** argv) { auto from = toMode ? openStore() : openStore(remoteUri); PathSet storePaths2; - for (auto& path : storePaths) + for (auto& path : storePaths) { storePaths2.insert(from->followLinksToStorePath(path)); + } PathSet closure; from->computeFSClosure(storePaths2, closure, false, includeOutputs); |