diff options
Diffstat (limited to 'third_party/nix/src/nix/show-config.cc')
-rw-r--r-- | third_party/nix/src/nix/show-config.cc | 42 |
1 files changed, 16 insertions, 26 deletions
diff --git a/third_party/nix/src/nix/show-config.cc b/third_party/nix/src/nix/show-config.cc index 86638b50d2c6..dba94732a9c3 100644 --- a/third_party/nix/src/nix/show-config.cc +++ b/third_party/nix/src/nix/show-config.cc @@ -1,40 +1,30 @@ #include "command.hh" #include "common-args.hh" +#include "json.hh" #include "shared.hh" #include "store-api.hh" -#include "json.hh" using namespace nix; -struct CmdShowConfig : Command, MixJSON -{ - CmdShowConfig() - { - } +struct CmdShowConfig : Command, MixJSON { + CmdShowConfig() {} - std::string name() override - { - return "show-config"; - } + std::string name() override { return "show-config"; } - std::string description() override - { - return "show the Nix configuration"; - } + std::string description() override { return "show the Nix configuration"; } - void run() override - { - if (json) { - // FIXME: use appropriate JSON types (bool, ints, etc). - JSONObject jsonObj(std::cout); - globalConfig.toJSON(jsonObj); - } else { - std::map<std::string, Config::SettingInfo> settings; - globalConfig.getSettings(settings); - for (auto & s : settings) - std::cout << s.first + " = " + s.second.value + "\n"; - } + void run() override { + if (json) { + // FIXME: use appropriate JSON types (bool, ints, etc). + JSONObject jsonObj(std::cout); + globalConfig.toJSON(jsonObj); + } else { + std::map<std::string, Config::SettingInfo> settings; + globalConfig.getSettings(settings); + for (auto& s : settings) + std::cout << s.first + " = " + s.second.value + "\n"; } + } }; static RegisterCommand r1(make_ref<CmdShowConfig>()); |