Пример #1
0
int workflow::execute(const int argc, const char* argv[]) {
    try {
        const auto o(generate_darting_options(argc, argv));

        /*
         * Can only happen if the options are valid but do not
         * require any action.
         */
        if (!o)
            return 0;

        const auto& s(*o);
        initialise_model_name(s);
        initialise_logging(s);
        dart(s);
    } catch (const darter::parser_validation_error& e) {
        /*
         * Log known not to be initialised as we are still parsing
         * command line options.
         */
        std::cerr << usage_error_msg << e.what() << std::endl
                  << more_information << std::endl;
        return 1;
    } catch (const std::exception& e) {
        report_exception(e);
        return 1;
    } catch(...) {
        report_exception();
        return 1;
    }
    return 0;
}
Пример #2
0
int gtk_module_init(gint argc, char *argv[]) {
  initialise_logging();
  autopilot_introspection = autopilot_introspection_skeleton_new ();
  g_bus_get (G_BUS_TYPE_SESSION, NULL, bus_acquired, NULL);
  // always log this:
  std::cout << "Autopilot GTK interface loaded. Wire protocol version is " << WIRE_PROTO_VERSION << "." << std::endl;
  return 0;
}