aboutsummaryrefslogtreecommitdiff
path: root/src/nix/path-info.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/path-info.cc
parentf15f0b8e83051cd95dacb2784b004c8272957f30 (diff)
Remove mkFlag()
Diffstat (limited to 'src/nix/path-info.cc')
-rw-r--r--src/nix/path-info.cc30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/nix/path-info.cc b/src/nix/path-info.cc
index 0fa88f1bf..518cd5568 100644
--- a/src/nix/path-info.cc
+++ b/src/nix/path-info.cc
@@ -18,10 +18,32 @@ struct CmdPathInfo : StorePathsCommand, MixJSON
CmdPathInfo()
{
- mkFlag('s', "size", "Print the size of the NAR serialisation of each path.", &showSize);
- mkFlag('S', "closure-size", "Print the sum of the sizes of the NAR serialisations of the closure of each path.", &showClosureSize);
- mkFlag('h', "human-readable", "With `-s` and `-S`, print sizes in a human-friendly format such as `5.67G`.", &humanReadable);
- mkFlag(0, "sigs", "Show signatures.", &showSigs);
+ addFlag({
+ .longName = "size",
+ .shortName = 's',
+ .description = "Print the size of the NAR serialisation of each path.",
+ .handler = {&showSize, true},
+ });
+
+ addFlag({
+ .longName = "closure-size",
+ .shortName = 'S',
+ .description = "Print the sum of the sizes of the NAR serialisations of the closure of each path.",
+ .handler = {&showClosureSize, true},
+ });
+
+ addFlag({
+ .longName = "human-readable",
+ .shortName = 'h',
+ .description = "With `-s` and `-S`, print sizes in a human-friendly format such as `5.67G`.",
+ .handler = {&humanReadable, true},
+ });
+
+ addFlag({
+ .longName = "sigs",
+ .description = "Show signatures.",
+ .handler = {&showSigs, true},
+ });
}
std::string description() override