diff -Nur balsa-2.3.8/src/ab-main.c balsa-2.3.8.new/src/ab-main.c --- balsa-2.3.8/src/ab-main.c 2005-07-07 15:01:24.000000000 +0000 +++ balsa-2.3.8.new/src/ab-main.c 2006-04-09 08:53:25.000000000 +0000 @@ -929,7 +929,7 @@ /* FIXME: do we need to allow a non-GUI mode? */ gtk_init_check(&argc, &argv); gnome_program_init(PACKAGE, VERSION, LIBGNOMEUI_MODULE, argc, argv, - GNOME_PARAM_POPT_TABLE, NULL, + GNOME_PARAM_GOPTION_CONTEXT, NULL, GNOME_PARAM_APP_PREFIX, BALSA_STD_PREFIX, GNOME_PARAM_APP_DATADIR, BALSA_STD_PREFIX "/share", NULL); diff -Nur balsa-2.3.8/src/main.c balsa-2.3.8.new/src/main.c --- balsa-2.3.8/src/main.c 2006-04-09 08:45:05.000000000 +0000 +++ balsa-2.3.8.new/src/main.c 2006-04-09 08:49:14.000000000 +0000 @@ -204,52 +204,47 @@ static void balsa_init(int argc, char **argv) { - poptContext context; - int opt; - static char *attachment = NULL; - static struct poptOption options[] = { + GOptionContext *context; + GnomeProgram *balsa; + static GOptionEntry options[] = { - {"checkmail", 'c', POPT_ARG_NONE, - &(cmd_check_mail_on_startup), 0, + {"checkmail", 'c', 0, + G_OPTION_ARG_NONE, &(cmd_check_mail_on_startup), N_("Get new mail on startup"), NULL}, - {"compose", 'm', POPT_ARG_STRING, &(opt_compose_email), - 0, N_("Compose a new email to EMAIL@ADDRESS"), "EMAIL@ADDRESS"}, - {"attach", 'a', POPT_ARG_STRING, &(attachment), - 'a', N_("Attach file at PATH"), "PATH"}, - {"open-mailbox", 'o', POPT_ARG_STRING, &(cmd_line_open_mailboxes), - 0, N_("Opens MAILBOXNAME"), N_("MAILBOXNAME")}, - {"open-unread-mailbox", 'u', POPT_ARG_NONE, - &(cmd_open_unread_mailbox), 0, + {"compose", 'm', 0, + G_OPTION_ARG_STRING, &(opt_compose_email), + N_("Compose a new email to EMAIL@ADDRESS"), "EMAIL@ADDRESS"}, + {"attach", 'a', 0, + G_OPTION_ARG_FILENAME_ARRAY, &(opt_attach_list), + N_("Attach file at PATH"), "PATH"}, + {"open-mailbox", 'o', 0, + G_OPTION_ARG_STRING, &(cmd_line_open_mailboxes), + N_("Opens MAILBOXNAME"), N_("MAILBOXNAME")}, + {"open-unread-mailbox", 'u', 0, + G_OPTION_ARG_NONE, &(cmd_open_unread_mailbox), N_("Opens first unread mailbox"), NULL}, - {"open-inbox", 'i', POPT_ARG_NONE, - &(cmd_open_inbox), 0, + {"open-inbox", 'i', 0, + G_OPTION_ARG_NONE, &(cmd_open_inbox), N_("Opens default Inbox on startup"), NULL}, - {"get-stats", 's', POPT_ARG_NONE, - &(cmd_get_stats), 0, + {"get-stats", 's', 0, + G_OPTION_ARG_NONE, &(cmd_get_stats), N_("Prints number unread and unsent messages"), NULL}, - {"debug-pop", 'd', POPT_ARG_NONE, &PopDebug, 0, + {"debug-pop", 'd', 0, + G_OPTION_ARG_NONE, &PopDebug, N_("Debug POP3 connection"), NULL}, - {"debug-imap", 'D', POPT_ARG_NONE, &ImapDebug, 0, + {"debug-imap", 'D', 0, + G_OPTION_ARG_NONE, &ImapDebug, 0, N_("Debug IMAP connection"), NULL}, - {NULL, '\0', 0, NULL, 0} /* end the list */ + { NULL } /* end the list */ }; - - context = poptGetContext(PACKAGE, argc, (const char **)argv, options, 0); - while((opt = poptGetNextOpt(context)) > 0) { - switch (opt) { - case 'a': - opt_attach_list = g_slist_append(opt_attach_list, - g_strdup(attachment)); - break; - } - } - poptFreeContext(context); + context = g_option_context_new("balsa"); + g_option_context_add_main_entries(context, options, NULL); /* Process remaining options, */ gnome_program_init(PACKAGE, VERSION, LIBGNOMEUI_MODULE, argc, argv, - GNOME_PARAM_POPT_TABLE, options, + GNOME_PARAM_GOPTION_CONTEXT, options, GNOME_PARAM_APP_PREFIX, BALSA_STD_PREFIX, GNOME_PARAM_APP_DATADIR, BALSA_STD_PREFIX "/share", GNOME_PARAM_HUMAN_READABLE_NAME, _("The Balsa E-Mail Client"),