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/libutil/config.hh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/libutil/config.hh') diff --git a/src/libutil/config.hh b/src/libutil/config.hh index 130f59e2b..919621091 100644 --- a/src/libutil/config.hh +++ b/src/libutil/config.hh @@ -9,6 +9,8 @@ namespace nix { class Args; class AbstractSetting; +class JSONPlaceholder; +class JSONObject; /* A class to simplify providing configuration settings. The typical use is to inherit Config and add Setting members: @@ -56,6 +58,8 @@ public: void applyConfigFile(const Path & path, bool fatal = false); void resetOverriden(); + + void toJSON(JSONObject & out); }; class AbstractSetting @@ -90,6 +94,8 @@ protected: virtual std::string to_string() = 0; + virtual void toJSON(JSONPlaceholder & out); + bool isOverriden() { return overriden; } }; @@ -122,6 +128,8 @@ public: void set(const std::string & str) override; std::string to_string() override; + + void toJSON(JSONPlaceholder & out) override; }; template -- cgit v1.2.3