Config: Separated configuration from defaults

This commit is contained in:
Paul Beckingham 2017-02-26 10:22:39 -05:00
parent 9bc8643ce5
commit a31434fd48
5 changed files with 397 additions and 423 deletions

View file

@ -37,6 +37,7 @@
#include <Table.h>
extern Context context;
extern std::string configurationDefaults;
////////////////////////////////////////////////////////////////////////////////
CmdShow::CmdShow ()
@ -253,7 +254,7 @@ int CmdShow::execute (std::string& output)
// Find all the values that match the defaults, for highlighting.
std::vector <std::string> default_values;
Config default_config;
default_config.setDefaults ();
default_config.parse (configurationDefaults);
for (auto& i : context.config)
if (i.second != default_config.get (i.first))