aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-23 19:12:48 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-23 19:12:48 +0000
commit9f780e37ec387b1e359637d6a820f6132c1a7f40 (patch)
treeb40e270940d7f2cf2bc294fac690ca74536b583e
parent005ba1b4c54b5f73ecf9f141bb099d46750db5b4 (diff)
downloadpaludis-9f780e37ec387b1e359637d6a820f6132c1a7f40.tar.gz
paludis-9f780e37ec387b1e359637d6a820f6132c1a7f40.tar.xz
Error if an invalid check is requested
-rw-r--r--src/clients/qualudis/qualudis.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/clients/qualudis/qualudis.cc b/src/clients/qualudis/qualudis.cc
index 67a9c73..641a59b 100644
--- a/src/clients/qualudis/qualudis.cc
+++ b/src/clients/qualudis/qualudis.cc
@@ -30,6 +30,7 @@
#include <cstdlib>
#include <iostream>
#include <algorithm>
+#include <set>
#include <libebt/libebt.hh>
#include <libwrapiter/libwrapiter.hh>
@@ -592,6 +593,23 @@ int main(int argc, char *argv[])
if (QualudisCommandLine::get_instance()->a_version.specified())
throw DoVersion();
+ if (QualudisCommandLine::get_instance()->a_qa_checks.specified())
+ {
+ std::set<std::string> all_keys;
+ qa::EbuildCheckMaker::get_instance()->copy_keys(std::inserter(all_keys, all_keys.begin()));
+ qa::FileCheckMaker::get_instance()->copy_keys(std::inserter(all_keys, all_keys.begin()));
+ qa::PackageDirCheckMaker::get_instance()->copy_keys(std::inserter(all_keys, all_keys.begin()));
+ qa::PerProfileEbuildCheckMaker::get_instance()->copy_keys(std::inserter(all_keys, all_keys.begin()));
+ qa::ProfileCheckMaker::get_instance()->copy_keys(std::inserter(all_keys, all_keys.begin()));
+ qa::ProfilesCheckMaker::get_instance()->copy_keys(std::inserter(all_keys, all_keys.begin()));
+
+ for (args::StringSetArg::Iterator q(QualudisCommandLine::get_instance()->a_qa_checks.begin_args()),
+ q_end(QualudisCommandLine::get_instance()->a_qa_checks.end_args()) ; q != q_end ; ++q)
+ if (all_keys.end() == all_keys.find(*q))
+ throw DoHelp("bad value '" + *q + "' for --" +
+ QualudisCommandLine::get_instance()->a_qa_checks.long_name());
+ }
+
if (QualudisCommandLine::get_instance()->a_describe.specified())
{
if (! QualudisCommandLine::get_instance()->empty())