aboutsummaryrefslogtreecommitdiff
path: root/src/nix/search.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix/search.cc')
-rw-r--r--src/nix/search.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/nix/search.cc b/src/nix/search.cc
index 4fa1e7837..2e38f7e4b 100644
--- a/src/nix/search.cc
+++ b/src/nix/search.cc
@@ -196,9 +196,8 @@ struct CmdSearch : InstallableCommand, MixJSON
for (auto & cursor : installable->getCursors(*state))
visit(*cursor, cursor->getAttrPath(), true);
- if (json) {
- std::cout << jsonOut->dump() << std::endl;
- }
+ if (json)
+ logger->cout("%s", *jsonOut);
if (!json && !results)
throw Error("no results for the given search term(s)!");