aboutsummaryrefslogtreecommitdiff
path: root/src/nix/hash.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-10-09 18:26:47 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-10-09 18:26:47 +0000
commit39de73550dd5579c2b3f14f7ce669d3f8ed85689 (patch)
tree79194a4ed21a04ebca269005d2e188532e460fab /src/nix/hash.cc
parentcfe791a638a3fdf53a2608f885c407bafc238094 (diff)
parente845d19ae368cb9ee6371c4b2fdbdc86a110d893 (diff)
Merge remote-tracking branch 'upstream/master' into fix-and-ci-static-builds
Diffstat (limited to 'src/nix/hash.cc')
-rw-r--r--src/nix/hash.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/nix/hash.cc b/src/nix/hash.cc
index 945d8e990..7f3d5717a 100644
--- a/src/nix/hash.cc
+++ b/src/nix/hash.cc
@@ -44,6 +44,7 @@ struct CmdHash : Command
switch (mode) {
case FileIngestionMethod::Flat:
d = "print cryptographic hash of a regular file";
+ break;
case FileIngestionMethod::Recursive:
d = "print cryptographic hash of the NAR serialisation of a path";
};
@@ -78,8 +79,8 @@ struct CmdHash : Command
}
};
-static RegisterCommand r1("hash-file", [](){ return make_ref<CmdHash>(FileIngestionMethod::Flat); });
-static RegisterCommand r2("hash-path", [](){ return make_ref<CmdHash>(FileIngestionMethod::Recursive); });
+static RegisterCommand rCmdHashFile("hash-file", [](){ return make_ref<CmdHash>(FileIngestionMethod::Flat); });
+static RegisterCommand rCmdHashPath("hash-path", [](){ return make_ref<CmdHash>(FileIngestionMethod::Recursive); });
struct CmdToBase : Command
{
@@ -111,10 +112,10 @@ struct CmdToBase : Command
}
};
-static RegisterCommand r3("to-base16", [](){ return make_ref<CmdToBase>(Base16); });
-static RegisterCommand r4("to-base32", [](){ return make_ref<CmdToBase>(Base32); });
-static RegisterCommand r5("to-base64", [](){ return make_ref<CmdToBase>(Base64); });
-static RegisterCommand r6("to-sri", [](){ return make_ref<CmdToBase>(SRI); });
+static RegisterCommand rCmdToBase16("to-base16", [](){ return make_ref<CmdToBase>(Base16); });
+static RegisterCommand rCmdToBase32("to-base32", [](){ return make_ref<CmdToBase>(Base32); });
+static RegisterCommand rCmdToBase64("to-base64", [](){ return make_ref<CmdToBase>(Base64); });
+static RegisterCommand rCmdToSRI("to-sri", [](){ return make_ref<CmdToBase>(SRI); });
/* Legacy nix-hash command. */
static int compatNixHash(int argc, char * * argv)
@@ -166,4 +167,4 @@ static int compatNixHash(int argc, char * * argv)
return 0;
}
-static RegisterLegacyCommand s1("nix-hash", compatNixHash);
+static RegisterLegacyCommand r_nix_hash("nix-hash", compatNixHash);