- GOptionContext *context = NULL;
- TnyPlatformFactory *fact = NULL;
- TnyAccountStore *account_store = NULL;
- ModestConf *modest_conf = NULL;
-
- GError *err = NULL;
- int retval = MODEST_ERR_NONE;
-
- static gboolean batch=FALSE;
- static gchar *mailto, *subject, *bcc, *cc, *body, *account;
-
- static GOptionEntry options[] = {
- { "mailto", 'm', 0, G_OPTION_ARG_STRING, &mailto,
- N_("New email to <addresses> (comma-separated)"), NULL},
- { "subject", 's', 0, G_OPTION_ARG_STRING, &subject,
- N_("Subject for a new mail"), NULL},
- { "body", 'b', 0, G_OPTION_ARG_STRING, &body,
- N_("Body for a new email"), NULL},
- { "cc", 'c', 0, G_OPTION_ARG_STRING, &cc,
- N_("Cc: addresses for a new mail (comma-separated)"), NULL},
- { "bcc", 'x', 0, G_OPTION_ARG_STRING, &bcc,
- N_("Bcc: addresses for a new mail (comma-separated)"), NULL},
- { "account", 'a', 0, G_OPTION_ARG_STRING, &account,
- N_("Account to use (if specified, default account is used)"), NULL},
- { "batch", 'y', 0, G_OPTION_ARG_NONE, &batch,
- N_("Run in batch mode (don't show UI)"), NULL},
- { NULL, 0, 0, 0, NULL, NULL, NULL }
- };
-
- bindtextdomain (GETTEXT_PACKAGE, MODEST_LOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-
- modest_debug_g_type_init ();
- modest_debug_logging_init ();
-
- g_thread_init (NULL);
-
- 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', exiting\n",
- err ? err->message : "");
- g_error_free (err);
- retval = MODEST_ERR_OPTIONS;
- goto cleanup;
- }
- g_option_context_free (context);