aboutsummaryrefslogtreecommitdiff
path: root/src/nix/hash.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-01-13 14:18:04 +0100
committerEelco Dolstra <edolstra@gmail.com>2021-01-13 14:18:04 +0100
commit3da9a9241cb9f8c284426c220ea285398d0328dd (patch)
tree76d285b2ff05458958a69618b153ec094c0ae49d /src/nix/hash.cc
parent4e9cec79bf5302108a031b3910f63baccf719eb5 (diff)
Convert option descriptions to Markdown
Diffstat (limited to 'src/nix/hash.cc')
-rw-r--r--src/nix/hash.cc19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/nix/hash.cc b/src/nix/hash.cc
index 6fd791f41..79d506ace 100644
--- a/src/nix/hash.cc
+++ b/src/nix/hash.cc
@@ -19,15 +19,15 @@ struct CmdHashBase : Command
CmdHashBase(FileIngestionMethod mode) : mode(mode)
{
- mkFlag(0, "sri", "print hash in SRI format", &base, SRI);
- mkFlag(0, "base64", "print hash in base-64", &base, Base64);
- mkFlag(0, "base32", "print hash in base-32 (Nix-specific)", &base, Base32);
- mkFlag(0, "base16", "print hash in base-16", &base, Base16);
+ 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(Flag::mkHashTypeFlag("type", &ht));
#if 0
mkFlag()
.longName("modulo")
- .description("compute hash modulo specified string")
+ .description("Compute the hash modulo specified the string.")
.labels({"modulus"})
.dest(&modulus);
#endif
@@ -40,15 +40,14 @@ struct CmdHashBase : Command
std::string description() override
{
- const char* d;
switch (mode) {
case FileIngestionMethod::Flat:
- d = "print cryptographic hash of a regular file";
- break;
+ return "print cryptographic hash of a regular file";
case FileIngestionMethod::Recursive:
- d = "print cryptographic hash of the NAR serialisation of a path";
+ return "print cryptographic hash of the NAR serialisation of a path";
+ default:
+ assert(false);
};
- return d;
}
void run() override