aboutsummaryrefslogtreecommitdiff
path: root/src/nix/ls.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/ls.cc
parentf15f0b8e83051cd95dacb2784b004c8272957f30 (diff)
Remove mkFlag()
Diffstat (limited to 'src/nix/ls.cc')
-rw-r--r--src/nix/ls.cc23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/nix/ls.cc b/src/nix/ls.cc
index c0b1ecb32..c1dc9a95b 100644
--- a/src/nix/ls.cc
+++ b/src/nix/ls.cc
@@ -17,9 +17,26 @@ struct MixLs : virtual Args, MixJSON
MixLs()
{
- mkFlag('R', "recursive", "List subdirectories recursively.", &recursive);
- mkFlag('l', "long", "Show detailed file information.", &verbose);
- mkFlag('d', "directory", "Show directories rather than their contents.", &showDirectory);
+ addFlag({
+ .longName = "recursive",
+ .shortName = 'R',
+ .description = "List subdirectories recursively.",
+ .handler = {&recursive, true},
+ });
+
+ addFlag({
+ .longName = "long",
+ .shortName = 'l',
+ .description = "Show detailed file information.",
+ .handler = {&verbose, true},
+ });
+
+ addFlag({
+ .longName = "directory",
+ .shortName = 'd',
+ .description = "Show directories rather than their contents.",
+ .handler = {&showDirectory, true},
+ });
}
void listText(ref<FSAccessor> accessor)