diff options
author | 2006-02-23 15:54:14 +0000 | |
---|---|---|
committer | 2006-02-23 15:54:14 +0000 | |
commit | 7a37d2d2e16dc3a9a9bd438575737dcbfb04dc7c (patch) | |
tree | 3d3f6b15311d6e915d700e5501f8d3cb8335f8d5 | |
parent | ee78d61d0d31fa0f3e343c1f6806b64c5905a9c0 (diff) | |
download | paludis-7a37d2d2e16dc3a9a9bd438575737dcbfb04dc7c.tar.gz paludis-7a37d2d2e16dc3a9a9bd438575737dcbfb04dc7c.tar.xz |
Add support for passing a specific category/package, instead of doing an entire directory.
-rw-r--r-- | AUTHORS | 2 | ||||
-rw-r--r-- | src/qualudis/qualudis.cc | 25 |
2 files changed, 23 insertions, 4 deletions
@@ -10,3 +10,5 @@ Stephen P. Bennett <spb@gentoo.org> Mark Loeser <halcy0n@gentoo.org> Contributor +John N. Laliberte <allanonjl@gentoo.org> + Contributor to Qualudis diff --git a/src/qualudis/qualudis.cc b/src/qualudis/qualudis.cc index 5d14caba7..395cb2514 100644 --- a/src/qualudis/qualudis.cc +++ b/src/qualudis/qualudis.cc @@ -402,10 +402,8 @@ int main(int argc, char *argv[]) if (QualudisCommandLine::get_instance()->a_help.specified()) throw DoHelp(); - if (1 != (QualudisCommandLine::get_instance()->a_check.specified() + - QualudisCommandLine::get_instance()->a_version.specified() + - QualudisCommandLine::get_instance()->a_describe.specified())) - throw DoHelp("you should specify exactly one action"); + if (QualudisCommandLine::get_instance()->empty()) + throw DoHelp(); if (! QualudisCommandLine::get_instance()->a_log_level.specified()) Log::get_instance()->set_log_level(ll_warning); @@ -477,6 +475,24 @@ int main(int argc, char *argv[]) return EXIT_SUCCESS; } + if (! QualudisCommandLine::get_instance()->empty()) + { + QualudisCommandLine *c1 = QualudisCommandLine::get_instance(); + QualudisCommandLine::ParametersIterator argit = c1->begin_parameters(), arge = c1->end_parameters(); + for ( ; argit != arge; ++argit ) + { + std::string arg = *argit; + try + { + do_check(FSEntry::cwd() / arg); + } + catch(const DirOpenError & e) + { + cout << e.message() << endl; + } + } + return EXIT_SUCCESS; + } throw InternalError(__PRETTY_FUNCTION__, "no action?"); } @@ -528,6 +544,7 @@ int main(int argc, char *argv[]) if (h.message.empty()) { cout << "Usage: " << argv[0] << " [options]" << endl; + cout << " or: " << argv[0] << " [package/category ..]" << endl; cout << endl; cout << *QualudisCommandLine::get_instance(); return EXIT_SUCCESS; |