aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/clients/cave/cmd_show-fmt.hh7
-rw-r--r--src/clients/cave/cmd_show.cc7
2 files changed, 11 insertions, 3 deletions
diff --git a/src/clients/cave/cmd_show-fmt.hh b/src/clients/cave/cmd_show-fmt.hh
index e57644aef..f6b7afc1a 100644
--- a/src/clients/cave/cmd_show-fmt.hh
+++ b/src/clients/cave/cmd_show-fmt.hh
@@ -65,7 +65,12 @@ const auto fs_permitted_choice_value_enum_values = make_format_string_fetcher("s
<< "%{column 30}Permitted values:" << "\\n";
const auto fs_permitted_choice_value_enum_value = make_format_string_fetcher("show/permitted_choice_value_enum_value", 1)
- << "%{column 34}" << param<'v'>() << param_if<'d'>() << ": " << "%{column 45}" << param<'d'>() << param_endif<'d'>() << "\\n";
+ << "%{column 34}" << param<'v'>() << param_if<'d'>() << ": "
+ << "%{column 45}" << param<'d'>() << param_endif<'d'>() << "\\n";
+
+const auto fs_permitted_choice_value_enum_value_chosen = make_format_string_fetcher("show/permitted_choice_value_enum_value_chosen", 1)
+ << "%{column 34}" << c::green_or_pink() << param<'v'>() << c::normal() << param_if<'d'>() << ": "
+ << "%{column 45}" << param<'d'>() << param_endif<'d'>() << "\\n";
const auto fs_metadata_value_raw = make_format_string_fetcher("show/metadata_value_raw", 2)
<< " " << param<'i'>() << param<'i'>() << param<'i'>() << param<'i'>()
diff --git a/src/clients/cave/cmd_show.cc b/src/clients/cave/cmd_show.cc
index 9fcd48585..606f47787 100644
--- a/src/clients/cave/cmd_show.cc
+++ b/src/clients/cave/cmd_show.cc
@@ -346,6 +346,7 @@ namespace
struct PermittedChoiceValueParameterValuesDisplayer
{
std::ostream & out;
+ const std::string actual_value;
void visit(const PermittedChoiceValueParameterIntegerValue & v) const
{
@@ -374,7 +375,9 @@ namespace
out << fuc(fs_permitted_choice_value_enum_values());
for (auto a(v.allowed_values_and_descriptions()->begin()), a_end(v.allowed_values_and_descriptions()->end()) ;
a != a_end ; ++a)
- out << fuc(fs_permitted_choice_value_enum_value(), fv<'v'>(a->first), fv<'d'>(a->second));
+ out << fuc(
+ actual_value == a->first ? fs_permitted_choice_value_enum_value_chosen() : fs_permitted_choice_value_enum_value(),
+ fv<'v'>(a->first), fv<'d'>(a->second));
}
}
};
@@ -965,7 +968,7 @@ namespace
if ((*v)->permitted_parameter_values())
{
- PermittedChoiceValueParameterValuesDisplayer d{out};
+ PermittedChoiceValueParameterValuesDisplayer d{out, (*v)->parameter()};
(*v)->permitted_parameter_values()->accept(d);
}
}