- static gboolean update, debug, reinstall;
- static gchar *mailto, *subject, *bcc, *cc, *body;
-
- static GOptionEntry options[] = {
- { "debug", 'd', 0, G_OPTION_ARG_NONE, &debug,
- "Run in debug mode" },
- { "update", 'u', 0, G_OPTION_ARG_NONE, &update,
- "Send/receive all accounts and exit"},
- { "mailto", 'm', 0, G_OPTION_ARG_STRING, &mailto,
- "Start writing a new email to <addresses>"},
- { "subject", 's', 0, G_OPTION_ARG_STRING, &subject,
- "Subject for a new mail"},
- { "body", 'b', 0, G_OPTION_ARG_STRING, &body,
- "Body for a new email"},
- { "cc", 0, 0, G_OPTION_ARG_STRING, &cc,
- "CC-addresses for a new mail (comma-separated)"},
- { "bcc", 0, 0, G_OPTION_ARG_STRING, &bcc,
- "BCC-adresses for a new mail (comma-separated)"},
- { "reinstall-factory-settings", 0, 0, G_OPTION_ARG_NONE, &reinstall,
- "Delete all settings and start over (*DESTRUCTIVE*)"
- },
- { NULL }
- };
-
-#ifdef IS_HILDON
- osso_context_t *osso_context;
-#endif
-
- g_type_init ();
-
- context = g_option_context_new (NULL);
- g_option_context_add_main_entries (context, options, NULL);
-
- if (!g_option_context_parse (context, &argc, &argv, &err)) {
- g_printerr ("modest: error in command line parameter(s): %s\n",
- err ? err->message : "");
- retval = 1;
- goto cleanup;
- }
-
- if (debug) {
- g_log_set_always_fatal (G_LOG_LEVEL_WARNING);
- }
-
- modest_conf = MODEST_CONF(modest_conf_new());
- if (!modest_conf) {
- g_warning ("failed to initialize config system");
- goto cleanup;