#include <paludis/paludis.hh>
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <set>
using namespace examples;
using std::cout;
using std::endl;
using std::setw;
using std::left;
using std::boolalpha;
using std::hex;
int main(int argc, char * argv[])
{
try
{
"example_version_spec", "EXAMPLE_VERSION_SPEC_OPTIONS", "EXAMPLE_VERSION_SPEC_CMDLINE");
std::set<VersionSpec> versions;
for (const auto & version : versions)
{
cout << version << ":" << endl;
cout << " " << left << setw(24) << "Hash value:" << " " << "0x" << hex << version.hash() << endl;
cout << " " << left << setw(24) << "Remove revision:" << " " << version.remove_revision() << endl;
cout << " " << left << setw(24) << "Revision only:" << " " << version.revision_only() << endl;
cout << " " << left << setw(24) << "Bump:" << " " << version.bump() << endl;
cout << " " << left << setw(24) << "Is scm?" << " " << boolalpha << version.is_scm() << endl;
cout << " " << left << setw(24) << "Has -try?" << " " << boolalpha << version.has_try_part() << endl;
cout << " " << left << setw(24) << "Has -scm?" << " " << boolalpha << version.has_scm_part() << endl;
cout << 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_SUCCESS;
}
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))
Definition version_spec.hh:109
VersionSpecOptions user_version_spec_options() PALUDIS_ATTRIBUTE((warn_unused_result)) PALUDIS_VISIBLE
Definition about_metadata-fwd.hh:24