about summary refs log tree commit diff
path: root/src/nix/show-config.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-04-20T15·34+0200
committerEelco Dolstra <edolstra@gmail.com>2017-04-20T15·34+0200
commitefa4bdbfcd1489527bcf6f20a49c9a3bca8bbf6b (patch)
tree0e965a2b8feb129623c221564e7ca208ce16fe2a /src/nix/show-config.cc
parent4410e9d995bcd53a7a4cff0bbee3917375adcba3 (diff)
Improve nix show-config --json
In particular, show descriptions. This could be used for manpage
generation etc.
Diffstat (limited to 'src/nix/show-config.cc')
-rw-r--r--src/nix/show-config.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/nix/show-config.cc b/src/nix/show-config.cc
index ba39e2bb29b3..aade2adeace4 100644
--- a/src/nix/show-config.cc
+++ b/src/nix/show-config.cc
@@ -31,8 +31,7 @@ struct CmdShowConfig : Command
         if (json) {
             // FIXME: use appropriate JSON types (bool, ints, etc).
             JSONObject jsonObj(std::cout, true);
-            for (auto & s : settings.getSettings())
-                jsonObj.attr(s.first, s.second);
+            settings.toJSON(jsonObj);
         } else {
             for (auto & s : settings.getSettings())
                 std::cout << s.first + " = " + s.second + "\n";