From efa4bdbfcd1489527bcf6f20a49c9a3bca8bbf6b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 20 Apr 2017 17:34:47 +0200 Subject: Improve nix show-config --json In particular, show descriptions. This could be used for manpage generation etc. --- src/nix/show-config.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/nix/show-config.cc') diff --git a/src/nix/show-config.cc b/src/nix/show-config.cc index ba39e2bb2..aade2adea 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"; -- cgit v1.2.3