aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-14 13:25:45 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-14 13:25:45 +0000
commit60792f6f2be532f9ccef9705fcd7aee2b615c672 (patch)
tree20a5d4b27c02ebe97d76330634f8b07125cbc3ca
parent884c420ae598e097bf0090fecd8f4c102352b62e (diff)
downloadpaludis-60792f6f2be532f9ccef9705fcd7aee2b615c672.tar.gz
paludis-60792f6f2be532f9ccef9705fcd7aee2b615c672.tar.xz
Add qualudis --describe
-rw-r--r--src/qualudis/qualudis.cc30
-rw-r--r--src/qualudis/qualudis_command_line.cc1
-rw-r--r--src/qualudis/qualudis_command_line.hh3
3 files changed, 33 insertions, 1 deletions
diff --git a/src/qualudis/qualudis.cc b/src/qualudis/qualudis.cc
index 27111ee..92b65ce 100644
--- a/src/qualudis/qualudis.cc
+++ b/src/qualudis/qualudis.cc
@@ -270,7 +270,8 @@ int main(int argc, char *argv[])
throw DoHelp();
if (1 != (QualudisCommandLine::get_instance()->a_check.specified() +
- QualudisCommandLine::get_instance()->a_version.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()->a_version.specified())
@@ -284,6 +285,33 @@ int main(int argc, char *argv[])
return do_check() ? EXIT_SUCCESS : EXIT_FAILURE;
}
+ if (QualudisCommandLine::get_instance()->a_describe.specified())
+ {
+ if (! QualudisCommandLine::get_instance()->empty())
+ throw DoHelp("describe action takes no parameters");
+
+ cout << "Package directory checks:" << endl;
+ std::list<std::string> package_dir_checks;
+ qa::PackageDirCheckMaker::get_instance()->copy_keys(std::back_inserter(package_dir_checks));
+ for (std::list<std::string>::const_iterator i(package_dir_checks.begin()),
+ i_end(package_dir_checks.end()) ; i != i_end ; ++i)
+ cout << " " << *i << ":" << endl << " " <<
+ (*qa::PackageDirCheckMaker::get_instance()->find_maker(*i))()->describe() << endl;
+ cout << endl;
+
+ cout << "File checks:" << endl;
+ std::list<std::string> file_checks;
+ qa::FileCheckMaker::get_instance()->copy_keys(std::back_inserter(file_checks));
+ for (std::list<std::string>::const_iterator i(file_checks.begin()),
+ i_end(file_checks.end()) ; i != i_end ; ++i)
+ cout << " " << *i << ":" << endl << " " <<
+ (*qa::FileCheckMaker::get_instance()->find_maker(*i))()->describe() << endl;
+ cout << endl;
+
+ return EXIT_SUCCESS;
+ }
+
+
throw InternalError(__PRETTY_FUNCTION__, "no action?");
}
catch (const DoVersion &)
diff --git a/src/qualudis/qualudis_command_line.cc b/src/qualudis/qualudis_command_line.cc
index c83e1b7..cc07b36 100644
--- a/src/qualudis/qualudis_command_line.cc
+++ b/src/qualudis/qualudis_command_line.cc
@@ -24,6 +24,7 @@ QualudisCommandLine::QualudisCommandLine() :
action_args(this, "Actions (specify exactly one)"),
a_check(&action_args, "check", 'c', "Check the current directory"),
+ a_describe(&action_args, "describe", 'd', "Describe checks"),
a_version(&action_args, "version", 'V', "Display program version"),
a_help(&action_args, "help", 'h', "Display program help"),
diff --git a/src/qualudis/qualudis_command_line.hh b/src/qualudis/qualudis_command_line.hh
index 8d77be9..2b58c88 100644
--- a/src/qualudis/qualudis_command_line.hh
+++ b/src/qualudis/qualudis_command_line.hh
@@ -29,6 +29,9 @@ class QualudisCommandLine :
/// --check
paludis::args::SwitchArg a_check;
+ /// --describe
+ paludis::args::SwitchArg a_describe;
+
/// --version
paludis::args::SwitchArg a_version;