aboutsummaryrefslogtreecommitdiff
path: root/src/nix/ls.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2023-01-02 20:53:39 +0100
committerEelco Dolstra <edolstra@gmail.com>2023-01-02 20:53:39 +0100
commit6b6965238506705382892b14ef22700fc5112c3d (patch)
treec5a0f04bee2bace1281d7c7b405c8214641072c8 /src/nix/ls.cc
parente0ab2069c975abf80db9fdca23f0c164df921829 (diff)
parent9af16c5f742300e831a2cc400e43df1e22f87f31 (diff)
Merge remote-tracking branch 'origin/master' into coerce-string
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);
}