path: root/src/clients
diff options
authorAvatar Saleem Abdulrasool <compnerd@compnerd.org> 2016-01-13 21:08:17 -0800
committerAvatar Saleem Abdulrasool <compnerd@compnerd.org> 2016-01-13 21:14:45 -0800
commitfff8a3b796153a2f5f5742cbfcfe55a31bb9ba60 (patch)
tree65bdff5f1c999639a196e4a2663fa0f2d7f58330 /src/clients
parent1684b446715907515359cd310c1e7bd93bad5a2e (diff)
support hiding suboptions
Introduce the concept of `SUBOPTIONS_NO_DESCRIBE` to the exheres profile. This allows suboptions to be silenced by default from the description list. This is useful in rare scenarios, such as `linguas`, where the suboption is common, has a large set of values. In such a case, the output of the descriptions would obscure the actual resolution and useful options. This new profile variable permits the profile to indicate to the "frontend" that the description should be squelched. Currently, this is consumed only by the cave frontend.
Diffstat (limited to 'src/clients')
1 files changed, 8 insertions, 0 deletions
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index 66cf06cc7..e8d18f133 100644
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -85,6 +85,7 @@
#include <paludis/dep_spec_annotations.hh>
#include <paludis/slot.hh>
+#include <algorithm>
#include <set>
#include <iterator>
#include <iostream>
@@ -583,6 +584,13 @@ namespace
+ if ((*k)->hide_description())
+ if (std::none_of((*k)->begin(), (*k)->end(),
+ [&old_choices](const std::shared_ptr<const ChoiceValue> & value) {
+ return show_choice_value_even_if_hidden(value, old_choices);
+ }))
+ continue;
bool shown_prefix_changed(false), shown_prefix_unchanged(false);
for (Choice::ConstIterator i((*k)->begin()), i_end((*k)->end()) ;
i != i_end ; ++i)