Improve nix show-config --json
In particular, show descriptions. This could be used for manpage generation etc.
This commit is contained in:
parent
4410e9d995
commit
efa4bdbfcd
6 changed files with 71 additions and 43 deletions
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue