about summary refs log tree commit diff
path: root/third_party/nix/src/nix/show-config.cc
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-17T15·31+0100
committerVincent Ambo <tazjin@google.com>2020-05-17T15·31+0100
commit0f2cf531f705d370321843e5ba9135b2ebdb5d19 (patch)
tree256feb13963a849ed96e89228fa05454c2a22363 /third_party/nix/src/nix/show-config.cc
parent65a1aae98ce5a237c9643e639e550c8b0c0be7f1 (diff)
style(3p/nix): Reformat project in Google C++ style r/740
Reformatted with:

    fd . -e hh -e cc | xargs clang-format -i
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 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>());