1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 08:31:16 +02:00

Improve nix show-config --json

In particular, show descriptions. This could be used for manpage
generation etc.
This commit is contained in:
Eelco Dolstra 2017-04-20 17:34:47 +02:00
parent 4410e9d995
commit efa4bdbfcd
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
6 changed files with 71 additions and 43 deletions

View file

@ -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<T> 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<typename T>