aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-10-04 00:13:45 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-10-04 00:13:45 +0000
commitf5410cba716ac552b6d6deebd8d4c3a2330cd149 (patch)
tree7062ac045fc32e16502ba90559075191907de909
parent3f2fedb3d4bed5f56c04111e55f1912460a23f94 (diff)
downloadpaludis-f5410cba716ac552b6d6deebd8d4c3a2330cd149.tar.gz
paludis-f5410cba716ac552b6d6deebd8d4c3a2330cd149.tar.xz
More doxygen work. Move common args into paludis/args/ so that examples can make use of them.
-rw-r--r--configure.ac1
-rw-r--r--doc/doc_main.doxygen2
-rw-r--r--doc/examples/Makefile.am25
-rw-r--r--doc/examples/example_action.cc160
-rw-r--r--doc/examples/example_command_line.cc96
-rw-r--r--doc/examples/example_command_line.hh88
-rw-r--r--doc/examples/example_contents.cc97
-rw-r--r--doc/examples/example_dep_label.cc106
-rw-r--r--doc/examples/example_dep_spec.cc177
-rw-r--r--paludis/args/Makefile.am29
-rw-r--r--paludis/args/args_handler.hh2
-rw-r--r--paludis/args/checks_arg.cc (renamed from src/common_args/checks_arg.cc)0
-rw-r--r--paludis/args/checks_arg.hh (renamed from src/common_args/checks_arg.hh)0
-rw-r--r--paludis/args/debug_build_arg.cc (renamed from src/common_args/debug_build_arg.cc)0
-rw-r--r--paludis/args/debug_build_arg.hh (renamed from src/common_args/debug_build_arg.hh)0
-rw-r--r--paludis/args/deps_option_arg.cc (renamed from src/common_args/deps_option_arg.cc)0
-rw-r--r--paludis/args/deps_option_arg.hh (renamed from src/common_args/deps_option_arg.hh)0
-rw-r--r--paludis/args/do_help.hh (renamed from src/common_args/do_help.hh)0
-rw-r--r--paludis/args/log_level_arg.cc (renamed from src/common_args/log_level_arg.cc)0
-rw-r--r--paludis/args/log_level_arg.hh (renamed from src/common_args/log_level_arg.hh)0
-rw-r--r--paludis/dep_label.hh2
-rw-r--r--paludis/dep_spec.cc12
-rw-r--r--paludis/dep_spec.hh74
-rw-r--r--paludis/dep_spec.se3
-rw-r--r--src/Makefile.am2
-rw-r--r--src/clients/accerso/Makefile.am2
-rw-r--r--src/clients/accerso/accerso.cc2
-rw-r--r--src/clients/accerso/command_line.hh8
-rw-r--r--src/clients/adjutrix/Makefile.am2
-rw-r--r--src/clients/adjutrix/command_line.hh2
-rw-r--r--src/clients/contrarius/Makefile.am2
-rw-r--r--src/clients/contrarius/command_line.hh2
-rw-r--r--src/clients/inquisitio/Makefile.am2
-rw-r--r--src/clients/inquisitio/command_line.hh2
-rw-r--r--src/clients/inquisitio/inquisitio.cc2
-rw-r--r--src/clients/instruo/Makefile.am2
-rw-r--r--src/clients/instruo/command_line.hh8
-rw-r--r--src/clients/instruo/instruo.cc2
-rw-r--r--src/clients/paludis/Makefile.am20
-rw-r--r--src/clients/paludis/command_line.hh8
-rw-r--r--src/clients/paludis/install.cc2
-rw-r--r--src/clients/paludis/paludis.cc2
-rw-r--r--src/clients/qualudis/Makefile.am2
-rw-r--r--src/clients/qualudis/qualudis.cc2
-rw-r--r--src/clients/qualudis/qualudis_command_line.hh2
-rw-r--r--src/common_args/Makefile.am17
46 files changed, 724 insertions, 245 deletions
diff --git a/configure.ac b/configure.ac
index c5a267d..c83ff41 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1310,7 +1310,6 @@ AC_OUTPUT(
src/clients/instruo/Makefile
src/clients/paludis/Makefile
src/clients/qualudis/Makefile
- src/common_args/Makefile
src/output/Makefile
test/Makefile
vim/Makefile
diff --git a/doc/doc_main.doxygen b/doc/doc_main.doxygen
index d809d85..987e3a5 100644
--- a/doc/doc_main.doxygen
+++ b/doc/doc_main.doxygen
@@ -51,6 +51,8 @@
* \section Examples
*
* - \ref example_dep_label.cc "example_dep_label.cc"
+ * - \ref example_dep_spec.cc "example_dep_spec.cc"
+ * - \ref example_dep_tree.cc "example_dep_tree.cc"
*/
/** \defgroup g_exceptions Exceptions
diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am
index 9b6e5ad..2a4d453 100644
--- a/doc/examples/Makefile.am
+++ b/doc/examples/Makefile.am
@@ -13,27 +13,50 @@ noinst_PROGRAMS = \
example_about \
example_action \
example_contents \
- example_dep_label
+ example_dep_label \
+ example_dep_spec
EXTRA_DIST = $(noinst_SCRIPTS)
+noinst_LIBRARIES = libpaludisexamples.a
+
+libpaludisexamples_a_SOURCES = \
+ example_command_line.hh \
+ example_command_line.cc
+
+libpaludisexamples_a_LIBADD = \
+ $(top_builddir)/paludis/args/libpaludisargs.la
+
example_about_SOURCES = example_about.cc
example_about_LDFLAGS = \
$(top_builddir)/paludis/libpaludis.la
example_action_SOURCES = example_action.cc
example_action_LDFLAGS = \
+ libpaludisexamples.a \
$(top_builddir)/paludis/libpaludis.la \
+ $(top_builddir)/paludis/args/libpaludisargs.la \
$(top_builddir)/paludis/environments/libpaludisenvironments.la
example_contents_SOURCES = example_contents.cc
example_contents_LDFLAGS = \
+ libpaludisexamples.a \
$(top_builddir)/paludis/libpaludis.la \
+ $(top_builddir)/paludis/args/libpaludisargs.la \
$(top_builddir)/paludis/environments/libpaludisenvironments.la
example_dep_label_SOURCES = example_dep_label.cc
example_dep_label_LDFLAGS = \
+ libpaludisexamples.a \
+ $(top_builddir)/paludis/libpaludis.la \
+ $(top_builddir)/paludis/args/libpaludisargs.la \
+ $(top_builddir)/paludis/environments/libpaludisenvironments.la
+
+example_dep_spec_SOURCES = example_dep_spec.cc
+example_dep_spec_LDFLAGS = \
+ libpaludisexamples.a \
$(top_builddir)/paludis/libpaludis.la \
+ $(top_builddir)/paludis/args/libpaludisargs.la \
$(top_builddir)/paludis/environments/libpaludisenvironments.la
built-sources : $(BUILT_SOURCES)
diff --git a/doc/examples/example_action.cc b/doc/examples/example_action.cc
index bfbe87f..e00f42f 100644
--- a/doc/examples/example_action.cc
+++ b/doc/examples/example_action.cc
@@ -14,94 +14,128 @@
*/
#include <paludis/paludis.hh>
+#include "example_command_line.hh"
#include <iostream>
using namespace paludis;
+using namespace examples;
+
using std::cout;
using std::endl;
-int main(int, char *[])
+int main(int argc, char * argv[])
{
int exit_status(0);
- /* We start with an Environment. */
- tr1::shared_ptr<Environment> env(EnvironmentMaker::get_instance()->make_from_spec(""));
+ try
+ {
+ CommandLine::get_instance()->run(argc, argv,
+ "example_action", "EXAMPLE_ACTION_OPTIONS", "EXAMPLE_ACTION_CMDLINE");
- /* Fetch package IDs for 'sys-apps/paludis'. */
- tr1::shared_ptr<const PackageIDSequence> ids(env->package_database()->query(
- query::Matches(PackageDepSpec("sys-apps/paludis", pds_pm_permissive)),
- qo_order_by_version));
+ /* We start with an Environment, respecting the user's '--environment' choice. */
+ tr1::shared_ptr<Environment> env(EnvironmentMaker::get_instance()->make_from_spec(
+ CommandLine::get_instance()->a_environment.argument()));
- /* For each ID: */
- for (PackageIDSet::ConstIterator i(ids->begin()), i_end(ids->end()) ;
- i != i_end ; ++i)
- {
- /* Do we support a FetchAction? We find out by creating a
- * SupportsActionTest<FetchAction> object, and querying via the
- * PackageID::supports_action method. */
- SupportsActionTest<FetchAction> supports_fetch_action;
- if (! (*i)->supports_action(supports_fetch_action))
- {
- cout << "ID '" << **i << "' does not support the fetch action." << endl;
- }
- else
+ /* Fetch package IDs for 'sys-apps/paludis'. */
+ tr1::shared_ptr<const PackageIDSequence> ids(env->package_database()->query(
+ query::Matches(PackageDepSpec("sys-apps/paludis", pds_pm_permissive)),
+ qo_order_by_version));
+
+ /* For each ID: */
+ for (PackageIDSet::ConstIterator i(ids->begin()), i_end(ids->end()) ;
+ i != i_end ; ++i)
{
- cout << "ID '" << **i << "' supports the fetch action, trying to fetch:" << endl;
-
- /* Carry out a FetchAction. We need to specify various options when
- * creating a FetchAction, controlling whether safe resume is used
- * and whether unneeded (e.g. due to disabled USE flags) source
- * files should still be fetched. */
- FetchAction fetch_action(FetchActionOptions::create()
- .fetch_unneeded(false)
- .safe_resume(true)
- );
- try
+ /* Do we support a FetchAction? We find out by creating a
+ * SupportsActionTest<FetchAction> object, and querying via the
+ * PackageID::supports_action method. */
+ SupportsActionTest<FetchAction> supports_fetch_action;
+ if (! (*i)->supports_action(supports_fetch_action))
{
- (*i)->perform_action(fetch_action);
+ cout << "ID '" << **i << "' does not support the fetch action." << endl;
}
- catch (const FetchActionError & e)
+ else
{
- exit_status |= 1;
-
- cout << "Caught FetchActionError, with the following details:" << endl;
-
- /* We might get detailed information about individual fetch
- * failures. */
- for (Sequence<FetchActionFailure>::ConstIterator f(e.failures()->begin()), f_end(e.failures()->end()) ;
- f != f_end ; ++f)
+ cout << "ID '" << **i << "' supports the fetch action, trying to fetch:" << endl;
+
+ /* Carry out a FetchAction. We need to specify various options when
+ * creating a FetchAction, controlling whether safe resume is used
+ * and whether unneeded (e.g. due to disabled USE flags) source
+ * files should still be fetched. */
+ FetchAction fetch_action(FetchActionOptions::create()
+ .fetch_unneeded(false)
+ .safe_resume(true)
+ );
+ try
+ {
+ (*i)->perform_action(fetch_action);
+ }
+ catch (const FetchActionError & e)
{
- cout << " * File '" << f->target_file << "': ";
+ exit_status |= 1;
- bool need_comma(false);
- if (f->requires_manual_fetching)
- {
- cout << "requires manual fetching";
- need_comma = true;
- }
+ cout << "Caught FetchActionError, with the following details:" << endl;
- if (f->failed_automatic_fetching)
+ /* We might get detailed information about individual fetch
+ * failures. */
+ for (Sequence<FetchActionFailure>::ConstIterator f(e.failures()->begin()), f_end(e.failures()->end()) ;
+ f != f_end ; ++f)
{
- if (need_comma)
- cout << ", ";
- cout << "failed automatic fetching";
- need_comma = true;
+ cout << " * File '" << f->target_file << "': ";
+
+ bool need_comma(false);
+ if (f->requires_manual_fetching)
+ {
+ cout << "requires manual fetching";
+ need_comma = true;
+ }
+
+ if (f->failed_automatic_fetching)
+ {
+ if (need_comma)
+ cout << ", ";
+ cout << "failed automatic fetching";
+ need_comma = true;
+ }
+
+ if (! f->failed_integrity_checks.empty())
+ {
+ if (need_comma)
+ cout << ", ";
+ cout << "failed integrity checks: " << f->failed_integrity_checks;
+ need_comma = true;
+ }
}
- if (! f->failed_integrity_checks.empty())
- {
- if (need_comma)
- cout << ", ";
- cout << "failed integrity checks: " << f->failed_integrity_checks;
- need_comma = true;
- }
+ cout << endl;
}
-
- cout << endl;
}
- }
+ cout << endl;
+ }
+ }
+ catch (const Exception & e)
+ {
+ /* Paludis exceptions can provide a handy human-readable backtrace and
+ * an explanation message. Where possible, these should be displayed. */
+ cout << endl;
+ cout << "Unhandled exception:" << endl
+ << " * " << e.backtrace("\n * ")
+ << e.message() << " (" << e.what() << ")" << endl;
+ return EXIT_FAILURE;
+ }
+ catch (const std::exception & e)
+ {
+ cout << endl;
+ cout << "Unhandled exception:" << endl
+ << " * " << e.what() << endl;
+ return EXIT_FAILURE;
+ }
+ catch (...)
+ {
cout << endl;
+ cout << "Unhandled exception:" << endl
+ << " * Unknown exception type. Ouch..." << endl;
+ return EXIT_FAILURE;
}
return exit_status;
diff --git a/doc/examples/example_command_line.cc b/doc/examples/example_command_line.cc
new file mode 100644
index 0000000..07d6dd9
--- /dev/null
+++ b/doc/examples/example_command_line.cc
@@ -0,0 +1,96 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/** \file
+ *
+ * Basic command line handling for most examples.
+ */
+
+#include "example_command_line.hh"
+#include <paludis/paludis.hh>
+#include <cstdlib>
+#include <iostream>
+
+using namespace paludis;
+using namespace examples;
+
+using std::cout;
+using std::endl;
+
+template class InstantiationPolicy<CommandLine, instantiation_method::SingletonTag>;
+
+CommandLine::CommandLine() :
+ ArgsHandler(),
+
+ action_args(this, "Actions",
+ "Selects which basic action to perform. At most one action should "
+ "be specified."),
+ a_version(&action_args, "version", 'V', "Display program version"),
+ a_help(&action_args, "help", 'h', "Display program help"),
+
+ general_args(this, "General options",
+ "Options which are relevant for most or all actions."),
+ a_log_level(&general_args, "log-level", '\0'),
+ a_environment(&general_args, "environment", 'E', "Environment specification (class:suffix, both parts optional)")
+{
+}
+
+std::string
+CommandLine::app_name() const
+{
+ return "example";
+}
+
+std::string
+CommandLine::app_synopsis() const
+{
+ return "An example app";
+}
+
+std::string
+CommandLine::app_description() const
+{
+ return "This is an example program.";
+}
+
+CommandLine::~CommandLine()
+{
+}
+
+void
+examples::show_help_and_exit(const char * const argv[])
+{
+ cout << "Usage: " << argv[0] << " [options]" << endl;
+ cout << endl;
+ cout << *CommandLine::get_instance();
+
+ exit(EXIT_SUCCESS);
+}
+
+void
+examples::show_version_and_exit()
+{
+ cout << PALUDIS_PACKAGE << " " << PALUDIS_VERSION_MAJOR << "."
+ << PALUDIS_VERSION_MINOR << "." << PALUDIS_VERSION_MICRO;
+ if (! std::string(PALUDIS_SUBVERSION_REVISION).empty())
+ cout << " svn " << PALUDIS_SUBVERSION_REVISION;
+ cout << endl;
+
+ exit(EXIT_SUCCESS);
+}
+
+void
+CommandLine::run(const int argc, const char * const * const argv, const std::string & client,
+ const std::string & env_var, const std::string & env_prefix)
+{
+ args::ArgsHandler::run(argc, argv, client, env_var, env_prefix);
+
+ if (CommandLine::get_instance()->a_log_level.specified())
+ Log::get_instance()->set_log_level(CommandLine::get_instance()->a_log_level.option());
+
+ if (CommandLine::get_instance()->a_help.specified())
+ show_help_and_exit(argv);
+
+ if (CommandLine::get_instance()->a_version.specified())
+ show_version_and_exit();
+}
+
diff --git a/doc/examples/example_command_line.hh b/doc/examples/example_command_line.hh
new file mode 100644
index 0000000..62a4d73
--- /dev/null
+++ b/doc/examples/example_command_line.hh
@@ -0,0 +1,88 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+#ifndef PALUDIS_GUARD_DOC_EXAMPLES_EXAMPLE_COMMAND_LINE_HH
+#define PALUDIS_GUARD_DOC_EXAMPLES_EXAMPLE_COMMAND_LINE_HH 1
+
+#include <paludis/args/args.hh>
+#include <paludis/args/log_level_arg.hh>
+#include <paludis/paludis.hh>
+
+/** \file
+ *
+ * Basic command line handling for most examples.
+ */
+
+namespace examples
+{
+ /**
+ * This class provides basic command line handling for most examples.
+ *
+ * Most Paludis clients should support at least '--help', '--version'
+ * and '--log-level'. If paludis::EnvironmentMaker is used to create
+ * the environment (as opposed to, say, paludis::NoConfigEnvironment),
+ * then '--environment' must also be an option.
+ *
+ * Clients are free to use whichever command line handling library they
+ * prefer, but for convenience all Paludis core clients use a common utility
+ * library with a much simpler interface than that provided by overly C-ish
+ * getopt derivatives.
+ *
+ * The command line is a singleton -- that is, only one instance of
+ * it exists globally. This avoids the need to pass around lots of
+ * parameters.
+ */
+ class CommandLine :
+ public paludis::args::ArgsHandler,
+ public paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>
+ {
+ friend class paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>;
+
+ private:
+ CommandLine();
+ ~CommandLine();
+
+ public:
+ virtual void run(const int, const char * const * const,
+ const std::string & client, const std::string & env_var,
+ const std::string & env_prefix);
+
+ ///\name Program information
+ ///\{
+
+ virtual std::string app_name() const;
+ virtual std::string app_synopsis() const;
+ virtual std::string app_description() const;
+
+ ///\}
+
+ ///\name Action arguments
+ ///\{
+
+ paludis::args::ArgsGroup action_args;
+ paludis::args::SwitchArg a_version;
+ paludis::args::SwitchArg a_help;
+
+ ///\}
+
+ ///\name General arguments
+ ///{
+
+ paludis::args::ArgsGroup general_args;
+ paludis::args::LogLevelArg a_log_level;
+ paludis::args::StringArg a_environment;
+
+ ///}
+ };
+
+ /**
+ * Show a '--help' message, and exit.
+ */
+ void show_help_and_exit(const char * const argv[]) PALUDIS_ATTRIBUTE((noreturn));
+
+ /**
+ * Show a '--version' message, and exit.
+ */
+ void show_version_and_exit() PALUDIS_ATTRIBUTE((noreturn));
+}
+
+#endif
diff --git a/doc/examples/example_contents.cc b/doc/examples/example_contents.cc
index ac62931..639e6f0 100644
--- a/doc/examples/example_contents.cc
+++ b/doc/examples/example_contents.cc
@@ -14,10 +14,13 @@
*/
#include <paludis/paludis.hh>
+#include "example_command_line.hh"
#include <iostream>
#include <iomanip>
using namespace paludis;
+using namespace examples;
+
using std::cout;
using std::endl;
using std::left;
@@ -62,47 +65,77 @@ namespace
};
}
-int main(int, char *[])
+int main(int argc, char * argv[])
{
int exit_status(0);
- /* We start with an Environment. */
- tr1::shared_ptr<Environment> env(EnvironmentMaker::get_instance()->make_from_spec(""));
-
- /* Fetch package IDs for installed 'sys-apps/paludis'. */
- tr1::shared_ptr<const PackageIDSequence> ids(env->package_database()->query(
- query::Matches(PackageDepSpec("sys-apps/paludis", pds_pm_permissive)) &
- query::SupportsAction<InstalledAction>(),
- qo_order_by_version));
-
- /* For each ID: */
- for (PackageIDSet::ConstIterator i(ids->begin()), i_end(ids->end()) ;
- i != i_end ; ++i)
+ try
{
- /* Do we have a contents key? PackageID _key() methods can return
- * a zero pointer. */
- if (! (*i)->contents_key())
- {
- cout << "ID '" << **i << "' does not provide a contents key." << endl;
- }
- else
+ CommandLine::get_instance()->run(argc, argv,
+ "example_action", "EXAMPLE_ACTION_OPTIONS", "EXAMPLE_ACTION_CMDLINE");
+
+ /* We start with an Environment, respecting the user's '--environment' choice. */
+ tr1::shared_ptr<Environment> env(EnvironmentMaker::get_instance()->make_from_spec(
+ CommandLine::get_instance()->a_environment.argument()));
+
+ /* Fetch package IDs for installed 'sys-apps/paludis'. */
+ tr1::shared_ptr<const PackageIDSequence> ids(env->package_database()->query(
+ query::Matches(PackageDepSpec("sys-apps/paludis", pds_pm_permissive)) &
+ query::SupportsAction<InstalledAction>(),
+ qo_order_by_version));
+
+ /* For each ID: */
+ for (PackageIDSet::ConstIterator i(ids->begin()), i_end(ids->end()) ;
+ i != i_end ; ++i)
{
- cout << "ID '" << **i << "' provides contents key:" << endl;
-
- /* Visit the contents key's value's entries with our visitor. We use
- * indirect_iterator because value()->begin() and ->end() return
- * iterators to tr1::shared_ptr<>s rather than raw objects. */
- ContentsPrinter p;
- std::for_each(
- indirect_iterator((*i)->contents_key()->value()->begin()),
- indirect_iterator((*i)->contents_key()->value()->end()),
- accept_visitor(p));
- }
+ /* Do we have a contents key? PackageID _key() methods can return
+ * a zero pointer. */
+ if (! (*i)->contents_key())
+ {
+ cout << "ID '" << **i << "' does not provide a contents key." << endl;
+ }
+ else
+ {
+ cout << "ID '" << **i << "' provides contents key:" << endl;
+
+ /* Visit the contents key's value's entries with our visitor. We use
+ * indirect_iterator because value()->begin() and ->end() return
+ * iterators to tr1::shared_ptr<>s rather than raw objects. */
+ ContentsPrinter p;
+ std::for_each(
+ indirect_iterator((*i)->contents_key()->value()->begin()),
+ indirect_iterator((*i)->contents_key()->value()->end()),
+ accept_visitor(p));
+ }
+ cout << endl;
+ }
+ }
+ catch (const Exception & e)
+ {
+ /* Paludis exceptions can provide a handy human-readable backtrace and
+ * an explanation message. Where possible, these should be displayed. */
+ cout << endl;
+ cout << "Unhandled exception:" << endl
+ << " * " << e.backtrace("\n * ")
+ << e.message() << " (" << e.what() << ")" << endl;
+ return EXIT_FAILURE;
+ }
+ catch (const std::exception & e)
+ {
cout << endl;
+ cout << "Unhandled exception:" << endl
+ << " * " << e.what() << endl;
+ return EXIT_FAILURE;
+ }
+ catch (...)
+ {
+ cout << endl;
+ cout << "Unhandled exception:" << endl
+ << " * Unknown exception type. Ouch..." << endl;
+ return EXIT_FAILURE;
}
return exit_status;
}
-
diff --git a/doc/examples/example_dep_label.cc b/doc/examples/example_dep_label.cc
index 98db511..920cd1e 100644
--- a/doc/examples/example_dep_label.cc
+++ b/doc/examples/example_dep_label.cc
@@ -15,6 +15,7 @@
*/
#include <paludis/paludis.hh>
+#include "example_command_line.hh"
#include <iostream>
#include <iomanip>
#include <algorithm>
@@ -23,6 +24,8 @@
#include <map>
using namespace paludis;
+using namespace examples;
+
using std::cout;
using std::endl;
using std::setw;
@@ -142,45 +145,76 @@ namespace
};
}
-int main(int, char *[])
+int main(int argc, char * argv[])
{
- /* We start with an Environment. */
- tr1::shared_ptr<Environment> env(EnvironmentMaker::get_instance()->make_from_spec(""));
-
- /* Fetch package IDs for all installed packages. */
- tr1::shared_ptr<const PackageIDSequence> ids(env->package_database()->query(
- query::SupportsAction<InstalledAction>(),
- qo_whatever));
-
- /* Store a map from distfile name to whether it is fetch restricted. */
- ResultsMap results;
-
- /* For each ID: */
- for (PackageIDSet::ConstIterator i(ids->begin()), i_end(ids->end()) ;
- i != i_end ; ++i)
+ try
{
- /* If we don't have a src_uri key, skip this package. All PackageID
- * _key() functions can potentially return zero pointers, so checking is
- * essential. */
- if (! (*i)->src_uri_key())
- continue;
-
- /* We need to know whether the default label for this package's src_uri
- * is restricted. */
- IsLabelRestrictedVisitor is_initial_label_restricted(false);
- (*i)->src_uri_key()->initial_label()->accept(is_initial_label_restricted);
-
- /* Create a visitor that will collect distfiles, and do the collecting. */
- DistfilesCollector collector(results, is_initial_label_restricted.result);
- (*i)->src_uri_key()->value()->accept(collector);
+ CommandLine::get_instance()->run(argc, argv,
+ "example_action", "EXAMPLE_ACTION_OPTIONS", "EXAMPLE_ACTION_CMDLINE");
+
+ /* We start with an Environment, respecting the user's '--environment' choice. */
+ tr1::shared_ptr<Environment> env(EnvironmentMaker::get_instance()->make_from_spec(
+ CommandLine::get_instance()->a_environment.argument()));
+
+ /* Fetch package IDs for all installed packages. */
+ tr1::shared_ptr<const PackageIDSequence> ids(env->package_database()->query(
+ query::SupportsAction<InstalledAction>(),
+ qo_whatever));
+
+ /* Store a map from distfile name to whether it is fetch restricted. */
+ ResultsMap results;
+
+ /* For each ID: */
+ for (PackageIDSet::ConstIterator i(ids->begin()), i_end(ids->end()) ;
+ i != i_end ; ++i)
+ {
+ /* If we don't have a src_uri key, skip this package. All PackageID
+ * _key() functions can potentially return zero pointers, so checking is
+ * essential. */
+ if (! (*i)->src_uri_key())
+ continue;
+
+ /* We need to know whether the default label for this package's src_uri
+ * is restricted. */
+ IsLabelRestrictedVisitor is_initial_label_restricted(false);
+ (*i)->src_uri_key()->initial_label()->accept(is_initial_label_restricted);
+
+ /* Create a visitor that will collect distfiles, and do the collecting. */
+ DistfilesCollector collector(results, is_initial_label_restricted.result);
+ (*i)->src_uri_key()->value()->accept(collector);
+ }
+
+ /* Display summary of results */
+ cout << left << setw(59) << "Distfile Name" << "| " << "Fetch Restricted?" << endl;
+ cout << std::string(59, '-') << "+" << std::string(18, '-') << endl;
+ for (ResultsMap::const_iterator r(results.begin()), r_end(results.end()) ;
+ r != r_end ; ++r)
+ cout << left << setw(59) << r->first << "| " << (r->second ? "yes" : "no") << endl;
+ }
+ catch (const Exception & e)
+ {
+ /* Paludis exceptions can provide a handy human-readable backtrace and
+ * an explanation message. Where possible, these should be displayed. */
+ cout << endl;
+ cout << "Unhandled exception:" << endl
+ << " * " << e.backtrace("\n * ")
+ << e.message() << " (" << e.what() << ")" << endl;
+ return EXIT_FAILURE;
+ }
+ catch (const std::exception & e)
+ {
+ cout << endl;
+ cout << "Unhandled exception:" << endl
+ << " * " << e.what() << endl;
+ return EXIT_FAILURE;
+ }
+ catch (...)
+ {
+ cout << endl;
+ cout << "Unhandled exception:" << endl
+ << " * Unknown exception type. Ouch..." << endl;
+ return EXIT_FAILURE;
}
-
- /* Display summary of results */
- cout << left << setw(59) << "Distfile Name" << "| " << "Fetch Restricted?" << endl;
- cout << std::string(59, '-') << "+" << std::string(18, '-') << endl;
- for (ResultsMap::const_iterator r(results.begin()), r_end(results.end()) ;
- r != r_end ; ++r)
- cout << left << setw(59) << r->first << "| " << (r->second ? "yes" : "no") << endl;
return EXIT_SUCCESS;
}
diff --git a/doc/examples/example_dep_spec.cc b/doc/examples/example_dep_spec.cc
new file mode 100644
index 0000000..f74eb79
--- /dev/null
+++ b/doc/examples/example_dep_spec.cc
@@ -0,0 +1,177 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/** \file
+ *
+ * Example \ref example_dep_spec.cc "example_dep_spec.cc" .
+ *
+ * \ingroup g_dep_spec
+ */
+
+/** \example example_dep_spec.cc
+ *
+ * This example demonstrates how to handle dependency specs.
+ *
+ * See \ref example_dep_label.cc "example_dep_label.cc" for labels.
+ * See \ref example_dep_tree.cc "example_dep_tree.cc" for trees.
+ */
+
+#include <paludis/paludis.hh>
+#include "example_command_line.hh"
+#include <iostream>
+#include <iomanip>
+#include <algorithm>
+#include <cstdlib>
+#include <list>
+#include <map>
+
+using namespace paludis;
+using namespace examples;
+
+using std::cout;
+using std::endl;
+using std::setw;
+using std::left;
+
+int main(int argc, char * argv[])
+{
+ try
+ {
+ CommandLine::get_instance()->run(argc, argv,
+ "example_action", "EXAMPLE_ACTION_OPTIONS", "EXAMPLE_ACTION_CMDLINE");
+
+ /* We start with an Environment, respecting the user's '--environment' choice. */
+ tr1::shared_ptr<Environment> env(EnvironmentMaker::get_instance()->make_from_spec(
+ CommandLine::get_instance()->a_environment.argument()));
+
+ /* For each command line parameter... */
+ for (CommandLine::ParametersConstIterator q(CommandLine::get_instance()->begin_parameters()),
+ q_end(CommandLine::get_instance()->end_parameters()) ; q != q_end ; ++q)
+ {
+ /* Create a PackageDepSpec from the parameter. For user-inputted
+ * data, pds_pm_permissive or pds_pm_unspecific should be used (only
+ * the latter allows wildcards). */
+ PackageDepSpec spec(*q, pds_pm_unspecific);
+
+ /* Display information about the PackageDepSpec. */
+ cout << "Information about '" << spec << "':" << endl;
+
+ if (spec.package_ptr())
+ cout << " " << left << setw(24) << "Package:" << " " << *spec.package_ptr() << endl;
+
+ if (spec.category_name_part_ptr())
+ cout << " " << left << setw(24) << "Category part:" << " " << *spec.category_name_part_ptr() << endl;
+
+ if (spec.package_name_part_ptr())
+ cout << " " << left << setw(24) << "Package part:" << " " << *spec.package_name_part_ptr() << endl;
+
+ if (spec.version_requirements_ptr() && ! spec.version_requirements_ptr()->empty())
+ {
+ cout << " " << left << setw(24) << "Version requirements:" << " ";
+ bool need_join(false);
+ for (VersionRequirements::ConstIterator r(spec.version_requirements_ptr()->begin()),
+ r_end(spec.version_requirements_ptr()->end()) ; r != r_end ; ++r)
+ {
+ if (need_join)
+ {
+ switch (spec.version_requirements_mode())
+ {
+ case vr_and:
+ cout << " and ";
+ break;
+
+ case vr_or:
+ cout << " or ";
+ break;
+
+ case last_vr:
+ throw InternalError(PALUDIS_HERE, "Bad version_requirements_mode");
+ }
+ }
+
+ cout << r->version_operator << r->version_spec;
+ need_join = true;
+ }
+ cout << endl;
+ }
+
+ if (spec.slot_ptr())
+ cout << " " << left << setw(24) << "Slot:" << " " << *spec.slot_ptr() << endl;
+
+ if (spec.repository_ptr())
+ cout << " " << left << setw(24) << "Repository:" << " " << *spec.repository_ptr() << endl;
+
+ if (spec.use_requirements_ptr() && ! spec.use_requirements_ptr()->empty())
+ {
+ cout << " " << left << setw(24) << "Use requirements:" << " ";
+ bool need_join(false);
+ for (UseRequirements::ConstIterator u(spec.use_requirements_ptr()->begin()),
+ u_end(spec.use_requirements_ptr()->end()) ; u != u_end ; ++u)
+ {
+ if (need_join)
+ cout << " and ";
+
+ switch (u->second)
+ {
+ case use_enabled:
+ case use_unspecified:
+ break;
+
+ case use_disabled:
+ cout << "-";
+ break;
+
+ case last_use:
+ throw InternalError(PALUDIS_HERE, "Bad use requirements");
+ }
+ cout << u->first;
+
+ need_join = true;
+ }
+ cout << endl;
+ }
+
+ /* And display packages matching that spec */
+ cout << " " << left << setw(24) << "Matches:" << " ";
+ tr1::shared_ptr<const PackageIDSequence> ids(
+ env->package_database()->query(query::Matches(spec), qo_order_by_version));
+ bool need_indent(false);
+ for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
+ i != i_end ; ++i)
+ {
+ if (need_indent)
+ cout << " " << left << setw(24) << "" << " ";
+ cout << **i << endl;
+ need_indent = true;
+ }
+
+ cout << endl;
+ }
+ }
+ catch (const Exception & e)
+ {
+ /* Paludis exceptions can provide a handy human-readable backtrace and
+ * an explanation message. Where possible, these should be displayed. */
+ cout << endl;
+ cout << "Unhandled exception:" << endl
+ << " * " << e.backtrace("\n * ")
+ << e.message() << " (" << e.what() << ")" << endl;
+ return EXIT_FAILURE;
+ }
+ catch (const std::exception & e)
+ {
+ cout << endl;
+ cout << "Unhandled exception:" << endl
+ << " * " << e.what() << endl;
+ return EXIT_FAILURE;
+ }
+ catch (...)
+ {
+ cout << endl;
+ cout << "Unhandled exception:" << endl
+ << " * Unknown exception type. Ouch..." << endl;
+ return EXIT_FAILURE;
+ }
+
+ return EXIT_SUCCESS;
+}
+
diff --git a/paludis/args/Makefile.am b/paludis/args/Makefile.am
index bb006fd..0e940be 100644
--- a/paludis/args/Makefile.am
+++ b/paludis/args/Makefile.am
@@ -8,15 +8,20 @@ TESTS = \
paludis_args_includedir = $(includedir)/paludis-$(PALUDIS_PC_SLOT)/paludis/args/
paludis_args_include_HEADERS = \
- args.hh \
- args_error.hh \
- args_group.hh \
- args_handler.hh \
- args_option.hh \
- bad_argument.hh \
- args_visitor.hh \
- args_dumper.hh \
- man.hh
+ args.hh \
+ args_error.hh \
+ args_group.hh \
+ args_handler.hh \
+ args_option.hh \
+ bad_argument.hh \
+ args_visitor.hh \
+ args_dumper.hh \
+ man.hh \
+ checks_arg.hh \
+ debug_build_arg.hh \
+ deps_option_arg.hh \
+ log_level_arg.hh \
+ do_help.hh
libpaludisargs_la_SOURCES = \
args.cc \
@@ -26,7 +31,11 @@ libpaludisargs_la_SOURCES = \
args_option.cc \
bad_argument.cc \
args_visitor.cc \
- args_dumper.cc
+ args_dumper.cc \
+ checks_arg.cc \
+ debug_build_arg.cc \
+ deps_option_arg.cc \
+ log_level_arg.cc
libpaludisman_a_SOURCES = \
man.cc
diff --git a/paludis/args/args_handler.hh b/paludis/args/args_handler.hh
index b7787f6..3d8bf8f 100644
--- a/paludis/args/args_handler.hh
+++ b/paludis/args/args_handler.hh
@@ -96,7 +96,7 @@ namespace paludis
* to the command line arguments. The fifth argument is used as
* a prefix to export our command line via the environment.
*/
- void run(const int, const char * const * const,
+ virtual void run(const int, const char * const * const,
const std::string & client, const std::string & env_var,
const std::string & env_prefix);
diff --git a/src/common_args/checks_arg.cc b/paludis/args/checks_arg.cc
index 3eb1775..3eb1775 100644
--- a/src/common_args/checks_arg.cc
+++ b/paludis/args/checks_arg.cc
diff --git a/src/common_args/checks_arg.hh b/paludis/args/checks_arg.hh
index b3a820d..b3a820d 100644
--- a/src/common_args/checks_arg.hh
+++ b/paludis/args/checks_arg.hh
diff --git a/src/common_args/debug_build_arg.cc b/paludis/args/debug_build_arg.cc
index 5d70844..5d70844 100644
--- a/src/common_args/debug_build_arg.cc
+++ b/paludis/args/debug_build_arg.cc
diff --git a/src/common_args/debug_build_arg.hh b/paludis/args/debug_build_arg.hh
index d35904b..d35904b 100644
--- a/src/common_args/debug_build_arg.hh
+++ b/paludis/args/debug_build_arg.hh
diff --git a/src/common_args/deps_option_arg.cc b/paludis/args/deps_option_arg.cc
index 0444113..0444113 100644
--- a/src/common_args/deps_option_arg.cc
+++ b/paludis/args/deps_option_arg.cc
diff --git a/src/common_args/deps_option_arg.hh b/paludis/args/deps_option_arg.hh
index 60775b0..60775b0 100644
--- a/src/common_args/deps_option_arg.hh
+++ b/paludis/args/deps_option_arg.hh
diff --git a/src/common_args/do_help.hh b/paludis/args/do_help.hh
index a5fa03f..a5fa03f 100644
--- a/src/common_args/do_help.hh
+++ b/paludis/args/do_help.hh
diff --git a/src/common_args/log_level_arg.cc b/paludis/args/log_level_arg.cc
index 441db39..441db39 100644
--- a/src/common_args/log_level_arg.cc
+++ b/paludis/args/log_level_arg.cc
diff --git a/src/common_args/log_level_arg.hh b/paludis/args/log_level_arg.hh
index c2efbc3..c2efbc3 100644
--- a/src/common_args/log_level_arg.hh
+++ b/paludis/args/log_level_arg.hh
diff --git a/paludis/dep_label.hh b/paludis/dep_label.hh
index 5980116..410e09b 100644
--- a/paludis/dep_label.hh
+++ b/paludis/dep_label.hh
@@ -34,6 +34,8 @@
* \section Examples
*
* - \ref example_dep_label.cc "example_dep_label.cc"
+ * - \ref example_dep_spec.cc "example_dep_spec.cc" (for specifications)
+ * - \ref example_dep_tree.cc "example_dep_tree.cc" (for specification trees)
*/
namespace paludis
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index 40d7847..af3ad5f 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -34,12 +34,6 @@
#include <list>
#include <map>
-/** \file
- * Implementation for dep_spec.hh things.
- *
- * \ingroup grpdepspecs
- */
-
using namespace paludis;
#include <paludis/dep_spec-se.cc>
@@ -849,6 +843,12 @@ UseRequirements::end() const
return ConstIterator(_imp->reqs.end());
}
+bool
+UseRequirements::empty() const
+{
+ return _imp->reqs.empty();
+}
+
UseRequirements::ConstIterator
UseRequirements::find(const UseFlagName & u) const
{
diff --git a/paludis/dep_spec.hh b/paludis/dep_spec.hh
index ef58b71..6be854c 100644
--- a/paludis/dep_spec.hh
+++ b/paludis/dep_spec.hh
@@ -37,9 +37,15 @@
#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
/** \file
- * Declarations for the DepSpec classes.
+ * Declarations for dependency spec classes.
*
- * \ingroup grpdepspecs
+ * \ingroup g_dep_spec
+ *
+ * \section Examples
+ *
+ * - \ref example_dep_spec.cc "example_dep_spec.cc" (for specifications)
+ * - \ref example_dep_label.cc "example_dep_label.cc" (for labels)
+ * - \ref example_dep_tree.cc "example_dep_tree.cc" (for specification trees)
*/
namespace paludis
@@ -47,7 +53,7 @@ namespace paludis
/**
* Base class for a dependency spec.
*
- * \ingroup grpdepspecs
+ * \ingroup g_dep_spec
* \nosubgrouping
*/
class PALUDIS_VISIBLE DepSpec :
@@ -88,7 +94,7 @@ namespace paludis
/**
* Represents a "|| ( )" dependency block.
*
- * \ingroup grpdepspecs
+ * \ingroup g_dep_spec
* \nosubgrouping
*/
class PALUDIS_VISIBLE AnyDepSpec :
@@ -109,7 +115,7 @@ namespace paludis
* Represents a ( first second third ) or top level group of dependency
* specs.
*
- * \ingroup grpdepspecs
+ * \ingroup g_dep_spec
* \nosubgrouping
*/
class PALUDIS_VISIBLE AllDepSpec :
@@ -129,7 +135,7 @@ namespace paludis
/**
* Represents a use? ( ) dependency spec.
*
- * \ingroup grpdepspecs
+ * \ingroup g_dep_spec
* \nosubgrouping
*/
class PALUDIS_VISIBLE UseDepSpec :
@@ -163,10 +169,9 @@ namespace paludis
};
/**
- * A StringDepSpec represents a non-composite dep spec with an associated
- * piece of text.
+ * A StringDepSpec represents a dep spec with an associated piece of text.
*
- * \ingroup grpdepspecs
+ * \ingroup g_dep_spec
* \nosubgrouping
*/
class PALUDIS_VISIBLE StringDepSpec :
@@ -200,7 +205,7 @@ namespace paludis
/**
* A selection of USE flag requirements.
*
- * \ingroup grpdepspecs
+ * \ingroup g_dep_spec
* \nosubgrouping
*/
class PALUDIS_VISIBLE UseRequirements :
@@ -238,6 +243,10 @@ namespace paludis
/// What state is desired for a particular use flag?
UseFlagState state(const UseFlagName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ /// Are we empty?
+ bool empty() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
};
/**
@@ -245,7 +254,7 @@ namespace paludis
* 'app-editors/vim'), possibly with associated version and SLOT
* restrictions.
*
- * \ingroup grpdepspecs
+ * \ingroup g_dep_spec
* \nosubgrouping
*/
class PALUDIS_VISIBLE PackageDepSpec :
@@ -296,17 +305,17 @@ namespace paludis
///\}
/**
- * Fetch the package name.
+ * Fetch the package name (may be a zero pointer).
*/
tr1::shared_ptr<const QualifiedPackageName> package_ptr() const;
/**
- * Fetch the package name part, if wildcarded.
+ * Fetch the package name part, if wildcarded, or a zero pointer otherwise.
*/
tr1::shared_ptr<const PackageNamePart> package_name_part_ptr() const;
/**
- * Fetch the category name part, if wildcarded.
+ * Fetch the category name part, if wildcarded, or a zero pointer otherwise.
*/
tr1::shared_ptr<const CategoryNamePart> category_name_part_ptr() const;
@@ -368,7 +377,7 @@ namespace paludis
/**
* A PlainTextDepSpec represents a plain text entry.
*
- * \ingroup grpdepspecs
+ * \ingroup g_dep_spec
* \nosubgrouping
*/
class PALUDIS_VISIBLE PlainTextDepSpec :
@@ -388,7 +397,8 @@ namespace paludis
/**
* A LicenseDepSpec represents a license entry.
*
- * \ingroup grpdepspecs
+ * \ingroup g_dep_spec
+ * \since 0.26
* \nosubgrouping
*/
class PALUDIS_VISIBLE LicenseDepSpec :
@@ -408,7 +418,12 @@ namespace paludis
/**
* A FetchableURIDepSpec represents a fetchable URI part.
*
- * \ingroup grpdepspecs
+ * It differs from a SimpleURIDepSpec in that it supports arrow notation. Arrows
+ * are used by exheres to allow downloading to a filename other than that used by
+ * the original URL.
+ *
+ * \ingroup g_dep_spec
+ * \since 0.26
* \nosubgrouping
*/
class PALUDIS_VISIBLE FetchableURIDepSpec :
@@ -422,8 +437,22 @@ namespace paludis
///\}
+ /**
+ * The original URL (that is, the text to the left of the arrow, if present,
+ * or the entire text otherwise).
+ */
std::string original_url() const;
+
+ /**
+ * The renamed URL filename (that is, the text to the right of the arrow,
+ * if present, or an empty string otherwise).
+ */
std::string renamed_url_suffix() const;
+
+ /**
+ * The filename (that is, the renamed URL suffix, if present, or the text
+ * after the final / in the original URL otherwise).
+ */
std::string filename() const;
virtual tr1::shared_ptr<DepSpec> clone() const PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -432,7 +461,10 @@ namespace paludis
/**
* A SimpleURIDepSpec represents a simple URI part.
*
- * \ingroup grpdepspecs
+ * Unlike FetchableURIDepSpec, arrow notation is not supported.
+ *
+ * \ingroup g_dep_spec
+ * \since 0.26
* \nosubgrouping
*/
class PALUDIS_VISIBLE SimpleURIDepSpec :
@@ -452,8 +484,8 @@ namespace paludis
/**
* Thrown if an invalid package dep spec specification is encountered.
*
- * \ingroup grpexceptions
- * \ingroup grpdepspecs
+ * \ingroup g_exceptions
+ * \ingroup g_dep_spec
* \nosubgrouping
*/
class PALUDIS_VISIBLE PackageDepSpecError :
@@ -473,7 +505,7 @@ namespace paludis
* 'app-editors/vim'), possibly with associated version and SLOT
* restrictions.
*
- * \ingroup grpdepspecs
+ * \ingroup g_dep_spec
* \nosubgrouping
*/
class PALUDIS_VISIBLE BlockDepSpec :
diff --git a/paludis/dep_spec.se b/paludis/dep_spec.se
index 38810d2..b915880 100644
--- a/paludis/dep_spec.se
+++ b/paludis/dep_spec.se
@@ -17,9 +17,8 @@ make_enum_PackageDepSpecParseMode()
* How to parse a PackageDepSpec string.
*
* \see PackageDepSpec
- * \ingroup grpdepspecs
+ * \ingroup g_dep_spec
*/
END
}
-
diff --git a/src/Makefile.am b/src/Makefile.am
index 0ff1388..87fb732 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = output common_args clients
+SUBDIRS = output clients
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
MAINTAINERCLEANFILES = Makefile.in
diff --git a/src/clients/accerso/Makefile.am b/src/clients/accerso/Makefile.am
index 4051bfd..67634cb 100644
--- a/src/clients/accerso/Makefile.am
+++ b/src/clients/accerso/Makefile.am
@@ -29,7 +29,6 @@ man_accerso_LDADD = \
$(top_builddir)/paludis/args/libpaludisman.a \
$(top_builddir)/paludis/util/libpaludisutil.la \
$(top_builddir)/paludis/libpaludismanpagethings.la \
- $(top_builddir)/src/common_args/libcommonargs.a \
$(top_builddir)/src/output/liboutput.a \
$(DYNAMIC_LD_LIBS)
@@ -44,7 +43,6 @@ accerso_LDADD = \
$(top_builddir)/paludis/util/libpaludisutil.la \
$(top_builddir)/paludis/environments/no_config/libpaludisnoconfigenvironment.la \
$(top_builddir)/src/output/liboutput.a \
- $(top_builddir)/src/common_args/libcommonargs.a \
$(DYNAMIC_LD_LIBS)
TESTS_ENVIRONMENT = env \
diff --git a/src/clients/accerso/accerso.cc b/src/clients/accerso/accerso.cc
index 262cf49..c0c38e5 100644
--- a/src/clients/accerso/accerso.cc
+++ b/src/clients/accerso/accerso.cc
@@ -18,7 +18,7 @@
*/
#include <output/colour.hh>
-#include <src/common_args/do_help.hh>
+#include <paludis/args/do_help.hh>
#include "command_line.hh"
#include <paludis/about.hh>
#include <paludis/action.hh>
diff --git a/src/clients/accerso/command_line.hh b/src/clients/accerso/command_line.hh
index 8ad998c..43b0eff 100644
--- a/src/clients/accerso/command_line.hh
+++ b/src/clients/accerso/command_line.hh
@@ -22,10 +22,10 @@
#include <paludis/args/args.hh>
#include <paludis/util/instantiation_policy.hh>
-#include <src/common_args/debug_build_arg.hh>
-#include <src/common_args/checks_arg.hh>
-#include <src/common_args/log_level_arg.hh>
-#include <src/common_args/deps_option_arg.hh>
+#include <paludis/args/debug_build_arg.hh>
+#include <paludis/args/checks_arg.hh>
+#include <paludis/args/log_level_arg.hh>
+#include <paludis/args/deps_option_arg.hh>
class CommandLine :
public paludis::args::ArgsHandler,
diff --git a/src/clients/adjutrix/Makefile.am b/src/clients/adjutrix/Makefile.am
index 527e835..6902cdc 100644
--- a/src/clients/adjutrix/Makefile.am
+++ b/src/clients/adjutrix/Makefile.am
@@ -30,7 +30,6 @@ man_adjutrix_LDADD = \
$(top_builddir)/paludis/util/libpaludisutil.la \
$(top_builddir)/paludis/libpaludismanpagethings.la \
$(top_builddir)/src/output/liboutput.a \
- $(top_builddir)/src/common_args/libcommonargs.a \
$(DYNAMIC_LD_LIBS)
adjutrix_SOURCES = \
@@ -57,7 +56,6 @@ adjutrix_LDADD = \
$(top_builddir)/paludis/repositories/libpaludisrepositories.la \
$(top_builddir)/paludis/selinux/libpaludisselinux.la \
$(top_builddir)/src/output/liboutput.a \
- $(top_builddir)/src/common_args/libcommonargs.a \
$(DYNAMIC_LD_LIBS)
TESTS_ENVIRONMENT = env \
diff --git a/src/clients/adjutrix/command_line.hh b/src/clients/adjutrix/command_line.hh
index 9a9eb0d..450585d 100644
--- a/src/clients/adjutrix/command_line.hh
+++ b/src/clients/adjutrix/command_line.hh
@@ -22,7 +22,7 @@
#include <paludis/args/args.hh>
#include <paludis/util/instantiation_policy.hh>
-#include <src/common_args/log_level_arg.hh>
+#include <paludis/args/log_level_arg.hh>
/** \file
* Declarations for the CommandLine class.
diff --git a/src/clients/contrarius/Makefile.am b/src/clients/contrarius/Makefile.am
index 0e6a3e3..20b905d 100644
--- a/src/clients/contrarius/Makefile.am
+++ b/src/clients/contrarius/Makefile.am
@@ -37,7 +37,6 @@ contrarius_LDADD = \
$(top_builddir)/paludis/util/libpaludisutil.la \
$(top_builddir)/paludis/dep_list/libpaludisdeplist.la \
$(top_builddir)/src/output/liboutput.a \
- $(top_builddir)/src/common_args/libcommonargs.a \
$(DYNAMIC_LD_LIBS)
contrarius_stage_options-sr.hh : contrarius_stage_options.sr $(top_srcdir)/misc/make_sr.bash
@@ -80,7 +79,6 @@ man_contrarius_LDADD = \
$(top_builddir)/paludis/args/libpaludisman.a \
$(top_builddir)/paludis/util/libpaludisutil.la \
$(top_builddir)/src/output/liboutput.a \
- $(top_builddir)/src/common_args/libcommonargs.a \
$(DYNAMIC_LD_LIBS)
CLEANFILES = *~ version_TEST gmon.out *.gcov *.gcno *.gcda
diff --git a/src/clients/contrarius/command_line.hh b/src/clients/contrarius/command_line.hh
index 4f955cd..25b8d1a 100644
--- a/src/clients/contrarius/command_line.hh
+++ b/src/clients/contrarius/command_line.hh
@@ -5,7 +5,7 @@
#include <paludis/args/args.hh>
#include <paludis/util/instantiation_policy.hh>
-#include <src/common_args/log_level_arg.hh>
+#include <paludis/args/log_level_arg.hh>
class CommandLine :
public paludis::args::ArgsHandler,
diff --git a/src/clients/inquisitio/Makefile.am b/src/clients/inquisitio/Makefile.am
index 2b50cd9..9e74208 100644
--- a/src/clients/inquisitio/Makefile.am
+++ b/src/clients/inquisitio/Makefile.am
@@ -27,7 +27,6 @@ man_inquisitio_LDADD = \
$(top_builddir)/paludis/args/libpaludisman.a \
$(top_builddir)/paludis/util/libpaludisutil.la \
$(top_builddir)/paludis/libpaludismanpagethings.la \
- $(top_builddir)/src/common_args/libcommonargs.a \
$(top_builddir)/src/output/liboutput.a \
$(DYNAMIC_LD_LIBS) \
$(PCREPLUSPLUS_LIBS)
@@ -50,7 +49,6 @@ inquisitio_LDADD = \
$(top_builddir)/paludis/util/libpaludisutil.la \
$(top_builddir)/paludis/environments/libpaludisenvironments.la \
$(top_builddir)/src/output/liboutput.a \
- $(top_builddir)/src/common_args/libcommonargs.a \
$(DYNAMIC_LD_LIBS) \
$(PCREPLUSPLUS_LIBS)
diff --git a/src/clients/inquisitio/command_line.hh b/src/clients/inquisitio/command_line.hh
index 2149c77..1e6d638 100644
--- a/src/clients/inquisitio/command_line.hh
+++ b/src/clients/inquisitio/command_line.hh
@@ -22,7 +22,7 @@
#include <paludis/args/args.hh>
#include <paludis/util/instantiation_policy.hh>
-#include <src/common_args/log_level_arg.hh>
+#include <paludis/args/log_level_arg.hh>
/** \file
* Declarations for the CommandLine class.
diff --git a/src/clients/inquisitio/inquisitio.cc b/src/clients/inquisitio/inquisitio.cc
index f1b598b..2e2c669 100644
--- a/src/clients/inquisitio/inquisitio.cc
+++ b/src/clients/inquisitio/inquisitio.cc
@@ -29,7 +29,7 @@
#include <paludis/environments/environment_maker.hh>
#include <src/output/colour.hh>
-#include <src/common_args/do_help.hh>
+#include <paludis/args/do_help.hh>
using namespace paludis;
using std::cout;
diff --git a/src/clients/instruo/Makefile.am b/src/clients/instruo/Makefile.am
index a5fdfee..65666f2 100644
--- a/src/clients/instruo/Makefile.am
+++ b/src/clients/instruo/Makefile.am
@@ -29,7 +29,6 @@ man_instruo_LDADD = \
$(top_builddir)/paludis/args/libpaludisman.a \
$(top_builddir)/paludis/util/libpaludisutil.la \
$(top_builddir)/paludis/libpaludismanpagethings.la \
- $(top_builddir)/src/common_args/libcommonargs.a \
$(top_builddir)/src/output/liboutput.a \
$(DYNAMIC_LD_LIBS)
@@ -44,7 +43,6 @@ instruo_LDADD = \
$(top_builddir)/paludis/util/libpaludisutil.la \
$(top_builddir)/paludis/environments/no_config/libpaludisnoconfigenvironment.la \
$(top_builddir)/src/output/liboutput.a \
- $(top_builddir)/src/common_args/libcommonargs.a \
$(DYNAMIC_LD_LIBS)
TESTS_ENVIRONMENT = env \
diff --git a/src/clients/instruo/command_line.hh b/src/clients/instruo/command_line.hh
index 873794c..1e6965d 100644
--- a/src/clients/instruo/command_line.hh
+++ b/src/clients/instruo/command_line.hh
@@ -22,10 +22,10 @@
#include <paludis/args/args.hh>
#include <paludis/util/instantiation_policy.hh>
-#include <src/common_args/debug_build_arg.hh>
-#include <src/common_args/checks_arg.hh>
-#include <src/common_args/log_level_arg.hh>
-#include <src/common_args/deps_option_arg.hh>
+#include <paludis/args/debug_build_arg.hh>
+#include <paludis/args/checks_arg.hh>
+#include <paludis/args/log_level_arg.hh>
+#include <paludis/args/deps_option_arg.hh>
class CommandLine :
public paludis::args::ArgsHandler,
diff --git a/src/clients/instruo/instruo.cc b/src/clients/instruo/instruo.cc
index 173fa18..3eae934 100644
--- a/src/clients/instruo/instruo.cc
+++ b/src/clients/instruo/instruo.cc
@@ -18,7 +18,7 @@
*/
#include <output/colour.hh>
-#include <src/common_args/do_help.hh>
+#include <paludis/args/do_help.hh>
#include "command_line.hh"
#include <paludis/about.hh>
#include <paludis/action.hh>
diff --git a/src/clients/paludis/Makefile.am b/src/clients/paludis/Makefile.am
index 8e741f0..e33b28f 100644
--- a/src/clients/paludis/Makefile.am
+++ b/src/clients/paludis/Makefile.am
@@ -31,7 +31,6 @@ man_paludis_LDADD = \
$(top_builddir)/paludis/args/libpaludisman.a \
$(top_builddir)/paludis/util/libpaludisutil.la \
$(top_builddir)/paludis/libpaludismanpagethings.la \
- $(top_builddir)/src/common_args/libcommonargs.a \
$(top_builddir)/src/output/liboutput.a \
$(DYNAMIC_LD_LIBS)
@@ -50,8 +49,6 @@ paludis_SOURCES = \
report.hh report.cc \
paludis.cc
-if MONOLITHIC
-
paludis_LDADD = \
$(top_builddir)/paludis/tasks/libpaludistasks.la \
$(top_builddir)/paludis/libpaludis.la \
@@ -59,26 +56,9 @@ paludis_LDADD = \
$(top_builddir)/paludis/util/libpaludisutil.la \
$(top_builddir)/paludis/environments/libpaludisenvironments.la \
$(top_builddir)/paludis/dep_list/libpaludisdeplist.la \
- $(top_builddir)/paludis/repositories/libpaludisrepositories.la \
$(top_builddir)/src/output/liboutput.a \
- $(top_builddir)/src/common_args/libcommonargs.a \
$(DYNAMIC_LD_LIBS)
-else
-
-paludis_LDADD = \
- $(top_builddir)/paludis/tasks/libpaludistasks.la \
- $(top_builddir)/paludis/libpaludis.la \
- $(top_builddir)/paludis/args/libpaludisargs.la \
- $(top_builddir)/paludis/util/libpaludisutil.la \
- $(top_builddir)/paludis/environments/libpaludisenvironments.la \
- $(top_builddir)/paludis/dep_list/libpaludisdeplist.la \
- $(top_builddir)/src/output/liboutput.a \
- $(top_builddir)/src/common_args/libcommonargs.a \
- $(DYNAMIC_LD_LIBS)
-
-endif
-
TESTS_ENVIRONMENT = env \
TEST_SCRIPT_DIR="$(srcdir)/" \
PALUDIS_NO_GLOBAL_HOOKS="yes" \
diff --git a/src/clients/paludis/command_line.hh b/src/clients/paludis/command_line.hh
index 55c8c2a..9c64326 100644
--- a/src/clients/paludis/command_line.hh
+++ b/src/clients/paludis/command_line.hh
@@ -22,10 +22,10 @@
#include <paludis/args/args.hh>
#include <paludis/util/instantiation_policy.hh>
-#include <src/common_args/debug_build_arg.hh>
-#include <src/common_args/checks_arg.hh>
-#include <src/common_args/log_level_arg.hh>
-#include <src/common_args/deps_option_arg.hh>
+#include <paludis/args/debug_build_arg.hh>
+#include <paludis/args/checks_arg.hh>
+#include <paludis/args/log_level_arg.hh>
+#include <paludis/args/deps_option_arg.hh>
/** \file
* Declarations for the CommandLine class.
diff --git a/src/clients/paludis/install.cc b/src/clients/paludis/install.cc
index 912c40c..75bb1d4 100644
--- a/src/clients/paludis/install.cc
+++ b/src/clients/paludis/install.cc
@@ -20,7 +20,7 @@
#include <src/output/colour.hh>
#include "install.hh"
#include <src/output/console_install_task.hh>
-#include <src/common_args/do_help.hh>
+#include <paludis/args/do_help.hh>
#include <iostream>
#include <limits>
diff --git a/src/clients/paludis/paludis.cc b/src/clients/paludis/paludis.cc
index b3dc2ba..0294049 100644
--- a/src/clients/paludis/paludis.cc
+++ b/src/clients/paludis/paludis.cc
@@ -31,7 +31,7 @@
#include "sync.hh"
#include "uninstall.hh"
-#include <src/common_args/do_help.hh>
+#include <paludis/args/do_help.hh>
#include <src/output/colour.hh>
#include <paludis/paludis.hh>
diff --git a/src/clients/qualudis/Makefile.am b/src/clients/qualudis/Makefile.am
index 1927bf4..974e07b 100644
--- a/src/clients/qualudis/Makefile.am
+++ b/src/clients/qualudis/Makefile.am
@@ -25,7 +25,6 @@ qualudis_LDADD = \
$(top_builddir)/paludis/util/libpaludisutil.la \
$(top_builddir)/paludis/selinux/libpaludisselinux.la \
$(top_builddir)/src/output/liboutput.a \
- $(top_builddir)/src/common_args/libcommonargs.a \
$(PCREPLUSPLUS_LIBS) \
$(LIBXML2DEPS_LIBS) \
$(DYNAMIC_LD_LIBS)
@@ -63,7 +62,6 @@ man_qualudis_LDADD = \
$(top_builddir)/paludis/util/libpaludisutil.la \
$(top_builddir)/paludis/libpaludismanpagethings.la \
$(top_builddir)/src/output/liboutput.a \
- $(top_builddir)/src/common_args/libcommonargs.a \
$(DYNAMIC_LD_LIBS)
CLEANFILES = *~ version_TEST gmon.out *.gcov *.gcno *.gcda
diff --git a/src/clients/qualudis/qualudis.cc b/src/clients/qualudis/qualudis.cc
index a017fc7..c6af6d4 100644
--- a/src/clients/qualudis/qualudis.cc
+++ b/src/clients/qualudis/qualudis.cc
@@ -41,7 +41,7 @@
#include "qualudis_command_line.hh"
#include <src/output/colour.hh>
-#include <src/common_args/do_help.hh>
+#include <paludis/args/do_help.hh>
#include "config.h"
diff --git a/src/clients/qualudis/qualudis_command_line.hh b/src/clients/qualudis/qualudis_command_line.hh
index 2ae0465..9d99e58 100644
--- a/src/clients/qualudis/qualudis_command_line.hh
+++ b/src/clients/qualudis/qualudis_command_line.hh
@@ -6,7 +6,7 @@
#include <paludis/args/args.hh>
#include <paludis/qa-fwd.hh>
#include <paludis/util/instantiation_policy.hh>
-#include <src/common_args/log_level_arg.hh>
+#include <paludis/args/log_level_arg.hh>
class QualudisCommandLine :
public paludis::args::ArgsHandler,
diff --git a/src/common_args/Makefile.am b/src/common_args/Makefile.am
deleted file mode 100644
index ee1c6f5..0000000
--- a/src/common_args/Makefile.am
+++ /dev/null
@@ -1,17 +0,0 @@
-CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
-MAINTAINERCLEANFILES = Makefile.in
-
-AM_CXXFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src @PALUDIS_CXXFLAGS@ @PALUDIS_CXXFLAGS_VISIBILITY@
-
-built-sources : $(BUILT_SOURCES)
- for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done
-
-noinst_LIBRARIES = libcommonargs.a
-
-libcommonargs_a_SOURCES = \
- do_help.hh \
- checks_arg.hh checks_arg.cc \
- debug_build_arg.hh debug_build_arg.cc \
- deps_option_arg.hh deps_option_arg.cc \
- log_level_arg.hh log_level_arg.cc
-