#include <paludis/paludis.hh>
#include <iostream>
#include <iomanip>
#include <cstdlib>
using namespace examples;
using std::cout;
using std::endl;
int main(int argc, char * argv[])
{
int exit_status(0);
try
{
"example_environment", "EXAMPLE_ENVIRONMENT_OPTIONS", "EXAMPLE_ENVIRONMENT_CMDLINE");
std::shared_ptr<const SetSpecTree> world(env->set(
SetName(
"world")));
if (world)
{
cout << "World set exists" << endl;
}
else
cout << "No world set defined" << endl;
}
{
cout << endl;
cout << "Unhandled exception:" << 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;
}
Definition exception.hh:77
std::string backtrace(const std::string &delim) const
const char * what() const noexcept override
const std::string & message() const noexcept
static CommandLine * get_instance() PALUDIS_ATTRIBUTE((warn_unused_result))
WrappedValue< SetNameTag > SetName
Definition name-fwd.hh:131
Definition about_metadata-fwd.hh:24