aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-14 11:11:46 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-14 11:11:46 +0100
commitf2307d56cfc3b7180099942ad7c049db4617e6bd (patch)
tree2918e7ddf07be3bca4bfdce88317c74d8bedea60
parent952df62b6bc4580925a569e55556501200efa6c1 (diff)
downloadpaludis-f2307d56cfc3b7180099942ad7c049db4617e6bd.tar.gz
paludis-f2307d56cfc3b7180099942ad7c049db4617e6bd.tar.xz
Make --visible work with --matching
-rw-r--r--src/clients/cave/cmd_find_candidates.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/clients/cave/cmd_find_candidates.cc b/src/clients/cave/cmd_find_candidates.cc
index 62754b5..5be86de 100644
--- a/src/clients/cave/cmd_find_candidates.cc
+++ b/src/clients/cave/cmd_find_candidates.cc
@@ -225,6 +225,12 @@ FindCandidatesCommand::run_hosted(
step("Searching matches");
std::shared_ptr<Generator> match_generator;
+ std::shared_ptr<Filter> mask_filter;
+
+ if (search_options.a_visible.specified())
+ mask_filter = std::make_shared<filter::NotMasked>();
+ else
+ mask_filter = std::make_shared<filter::All>();
for (args::StringSetArg::ConstIterator k(search_options.a_matching.begin_args()),
k_end(search_options.a_matching.end_args()) ;
@@ -241,13 +247,13 @@ FindCandidatesCommand::run_hosted(
if (search_options.a_all_versions.specified())
{
const std::shared_ptr<const PackageIDSequence> ids((*env)[selection::AllVersionsUnsorted(
- *match_generator)]);
+ *match_generator | *mask_filter)]);
check_candidates(yield, step, ids);
}
else
{
const std::shared_ptr<const PackageIDSequence> ids((*env)[selection::BestVersionOnly(
- *match_generator)]);
+ *match_generator | *mask_filter)]);
check_candidates(yield, step, ids);
}
}