aboutsummaryrefslogtreecommitdiff
path: root/src/nix/ls.cc
diff options
context:
space:
mode:
authorYorick van Pelt <yorick@yorickvanpelt.nl>2022-11-16 16:49:49 +0100
committerYorick van Pelt <yorick@yorickvanpelt.nl>2022-11-16 16:50:50 +0100
commit09f00dd4d01aa1b6866978d162022133e521614f (patch)
tree1d7470dfc9d7bb997d684294e0048280079a11a2 /src/nix/ls.cc
parent62960f32915909a5104f2ca3a32b25fb3cfd34c7 (diff)
Replace src/libutil/json.cc with nlohmann json generation
Diffstat (limited to 'src/nix/ls.cc')
-rw-r--r--src/nix/ls.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/nix/ls.cc b/src/nix/ls.cc
index 07554994b..e964b01b3 100644
--- a/src/nix/ls.cc
+++ b/src/nix/ls.cc
@@ -3,7 +3,7 @@
#include "fs-accessor.hh"
#include "nar-accessor.hh"
#include "common-args.hh"
-#include "json.hh"
+#include <nlohmann/json.hpp>
using namespace nix;
@@ -91,10 +91,9 @@ struct MixLs : virtual Args, MixJSON
if (path == "/") path = "";
if (json) {
- JSONPlaceholder jsonRoot(std::cout);
if (showDirectory)
throw UsageError("'--directory' is useless with '--json'");
- listNar(jsonRoot, accessor, path, recursive);
+ std::cout << listNar(accessor, path, recursive);
} else
listText(accessor);
}