aboutsummaryrefslogtreecommitdiff
path: root/src/nix/hash.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-01-27 12:06:03 +0100
committerEelco Dolstra <edolstra@gmail.com>2021-01-27 12:06:03 +0100
commit8e758d402ba1045c7b8273f8cb1d6d8d917ca52b (patch)
tree04c5bc22912b684a41cd4cfdd5c895127ce339a4 /src/nix/hash.cc
parentf15f0b8e83051cd95dacb2784b004c8272957f30 (diff)
Remove mkFlag()
Diffstat (limited to 'src/nix/hash.cc')
-rw-r--r--src/nix/hash.cc43
1 files changed, 33 insertions, 10 deletions
diff --git a/src/nix/hash.cc b/src/nix/hash.cc
index 79d506ace..4535e4ab0 100644
--- a/src/nix/hash.cc
+++ b/src/nix/hash.cc
@@ -19,18 +19,41 @@ struct CmdHashBase : Command
CmdHashBase(FileIngestionMethod mode) : mode(mode)
{
- mkFlag(0, "sri", "Print the hash in SRI format.", &base, SRI);
- mkFlag(0, "base64", "Print the hash in base-64 format.", &base, Base64);
- mkFlag(0, "base32", "Print the hash in base-32 (Nix-specific) format.", &base, Base32);
- mkFlag(0, "base16", "Print the hash in base-16 format.", &base, Base16);
+ addFlag({
+ .longName = "sri",
+ .description = "Print the hash in SRI format.",
+ .handler = {&base, SRI},
+ });
+
+ addFlag({
+ .longName = "base64",
+ .description = "Print the hash in base-64 format.",
+ .handler = {&base, Base64},
+ });
+
+ addFlag({
+ .longName = "base32",
+ .description = "Print the hash in base-32 (Nix-specific) format.",
+ .handler = {&base, Base32},
+ });
+
+ addFlag({
+ .longName = "base16",
+ .description = "Print the hash in base-16 format.",
+ .handler = {&base, Base16},
+ });
+
addFlag(Flag::mkHashTypeFlag("type", &ht));
+
#if 0
- mkFlag()
- .longName("modulo")
- .description("Compute the hash modulo specified the string.")
- .labels({"modulus"})
- .dest(&modulus);
- #endif
+ addFlag({
+ .longName = "modulo",
+ .description = "Compute the hash modulo the specified string.",
+ .labels = {"modulus"},
+ .handler = {&modulus},
+ });
+ #endif\
+
expectArgs({
.label = "paths",
.handler = {&paths},