Skip to content

Commit

Permalink
settings: mark user modified values
Browse files Browse the repository at this point in the history
  • Loading branch information
mcspr committed Jun 15, 2024
1 parent 0173e22 commit 9e1b25f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions code/espurna/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,18 +230,22 @@ std::vector<String> sorted_keys() {
namespace terminal {
namespace {

void dump_impl(const ::terminal::CommandContext& ctx, const Key& key, const String& value) {
ctx.output.printf_P(
PSTR("> %s => %s%s\n"),
key.c_str(), value.c_str(),
hasSetting(key) ? " (*)" : "");
}

void dump(const ::terminal::CommandContext& ctx, const query::Setting* begin, const query::Setting* end) {
for (auto it = begin; it != end; ++it) {
ctx.output.printf_P(PSTR("> %s => %s\n"),
(*it).key().c_str(), (*it).value().c_str());
dump_impl(ctx, (*it).key(), (*it).value());
}
}

void dump(const ::terminal::CommandContext& ctx, const query::IndexedSetting* begin, const query::IndexedSetting* end, size_t index) {
for (auto it = begin; it != end; ++it) {
ctx.output.printf_P(PSTR("> %s%u => %s\n"),
(*it).prefix().c_str(), index,
(*it).value(index).c_str());
dump_impl(ctx, {(*it).prefix(), index}, (*it).value(index));
}
}

Expand Down

0 comments on commit 9e1b25f

Please sign in to comment.