mirror of
https://github.com/NixOS/nix
synced 2025-07-07 06:01:48 +02:00
nix hash convert: s/--type/--algo/ + more functional tests
https://github.com/NixOS/nix/issues/8876
This commit is contained in:
parent
6bbd900d4f
commit
0c2d5f7673
3 changed files with 71 additions and 10 deletions
|
@ -40,7 +40,6 @@ enum struct HashFormat : int {
|
|||
SRI
|
||||
};
|
||||
|
||||
|
||||
struct Hash
|
||||
{
|
||||
constexpr static size_t maxHashSize = 64;
|
||||
|
|
|
@ -162,9 +162,9 @@ struct CmdHashConvert : Command
|
|||
}},
|
||||
});
|
||||
addFlag({
|
||||
.longName = "type",
|
||||
.description = "Specify the type if it can't be auto-detected.",
|
||||
.labels = {"hash type"},
|
||||
.longName = "algo",
|
||||
.description = "Specify the algorithm if it can't be auto-detected.",
|
||||
.labels = {"hash algorithm"},
|
||||
.handler = {[this](std::string str) {
|
||||
type = parseHashType(str);
|
||||
}},
|
||||
|
@ -177,7 +177,7 @@ struct CmdHashConvert : Command
|
|||
|
||||
std::string description() override
|
||||
{
|
||||
return "convert between different hash formats, e.g. base16 and sri.";
|
||||
return "convert between different hash formats, e.g. base16, nix32, base64 and sri.";
|
||||
}
|
||||
|
||||
Category category() override { return catUtility; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue