about summary refs log tree commit diff
path: root/third_party/nix/src/nix/show-config.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/nix/show-config.cc')
-rw-r--r--third_party/nix/src/nix/show-config.cc42
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 86638b50d2..dba94732a9 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>());