- GOptionContext *context = NULL;
-
- GError *err = NULL;
- int retval = MODEST_ERR_NONE;
-
- static gboolean batch = FALSE;
- static gchar *mailto=NULL, *subject=NULL, *bcc=NULL,
- *cc=NULL, *body=NULL, *account=NULL;
- gchar *account_or_default;
- 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 none specified, the default account will be 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 }
- };
-
- 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);
- g_option_context_free (context);
- retval = MODEST_ERR_OPTIONS;
- goto cleanup;