aboutsummaryrefslogtreecommitdiff
path: root/src/clients/qualudis/qualudis.cc
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-01-07 01:25:51 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-01-07 01:25:51 +0000
commitf33acc94ef72bb4c0aebf79fe4393d4aa308f686 (patch)
treecdc0976e7a60ff3e61d70343ea10af8f1fdde60a /src/clients/qualudis/qualudis.cc
parentff8a2c2894bc88278fea2e114ead3143be8696ff (diff)
downloadpaludis-f33acc94ef72bb4c0aebf79fe4393d4aa308f686.tar.gz
paludis-f33acc94ef72bb4c0aebf79fe4393d4aa308f686.tar.xz
Add --show-associated-keys argument to qualudis.
Diffstat (limited to 'src/clients/qualudis/qualudis.cc')
-rw-r--r--src/clients/qualudis/qualudis.cc20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/clients/qualudis/qualudis.cc b/src/clients/qualudis/qualudis.cc
index 58ae97c..131f7ec 100644
--- a/src/clients/qualudis/qualudis.cc
+++ b/src/clients/qualudis/qualudis.cc
@@ -172,11 +172,14 @@ namespace
FSEntry previous_entry;
std::string previous_name;
+ bool show_keys, show_keys_once;
std::set<const MetadataKey *> printed_keys;
- QualudisReporter() :
+ QualudisReporter(const std::string & show_associated_keys) :
previous_entry("/NONE"),
- previous_name("NONE")
+ previous_name("NONE"),
+ show_keys("never" != show_associated_keys),
+ show_keys_once("once" == show_associated_keys)
{
}
@@ -233,14 +236,17 @@ namespace
std::cout << " " << stringify(**i) << std::endl;
}
- if (! msg.associated_keys->empty())
+ if (show_keys && ! msg.associated_keys->empty())
{
for (QAMessage::KeysSequence::ConstIterator i(msg.associated_keys->begin()),
i_end(msg.associated_keys->end()) ; i != i_end ; ++i)
{
- if (printed_keys.end() != printed_keys.find(&**i))
- continue;
- printed_keys.insert(&**i);
+ if (show_keys_once)
+ {
+ if (printed_keys.end() != printed_keys.find(&**i))
+ continue;
+ printed_keys.insert(&**i);
+ }
MetadataKeyPrettyPrinter pp;
(*i)->accept(pp);
@@ -315,7 +321,7 @@ int main(int argc, char *argv[])
if (! env->main_repository()->qa_interface)
throw ConfigurationError("Repository '" + stringify(env->main_repository()->name()) + "' does not support QA checks");
- QualudisReporter r;
+ QualudisReporter r(QualudisCommandLine::get_instance()->a_show_associated_keys.argument());
if (QualudisCommandLine::get_instance()->empty())
{
env->main_repository()->qa_interface->check_qa(