gnome-volume-manager r1302 - in trunk: . src



Author: fejj
Date: Fri Jan 18 16:42:38 2008
New Revision: 1302
URL: http://svn.gnome.org/viewvc/gnome-volume-manager?rev=1302&view=rev

Log:
2008-01-18  Jeffrey Stedfast  <fejj novell com>

	* src/manager.c (main): Use a GOptionContext rather than
	popt. Fixes bug #327587.



Modified:
   trunk/ChangeLog
   trunk/src/manager.c

Modified: trunk/src/manager.c
==============================================================================
--- trunk/src/manager.c	(original)
+++ trunk/src/manager.c	Fri Jan 18 16:42:38 2008
@@ -3969,16 +3969,16 @@
 static gboolean no_daemon = FALSE;
 static gboolean secret_mode = FALSE;
 
-static const struct poptOption options[] = {
-	{ "version", 'v', POPT_ARG_NONE | POPT_ARGFLAG_ONEDASH, &print_version, 'v',
+static GOptionEntry options[] = {
+	{ "version", 'v', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_NONE, &print_version,
 	  N_("Print version and exit"), NULL },
-	{ "daemon", 'd', POPT_ARG_STRING | POPT_ARGFLAG_ONEDASH, (char **) &daemon_arg, 'd',
+	{ "daemon", 'd', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_STRING, (char **) &daemon_arg,
 	  N_("Run as a daemon"), "<yes|no>" },
-	{ "no-daemon", 'n', POPT_ARG_NONE | POPT_ARGFLAG_ONEDASH, &no_daemon, 'n',
+	{ "no-daemon", 'n', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_NONE, &no_daemon,
 	  N_("Don't run as a daemon"), NULL },
-	{ "secret-mode", 's', POPT_ARG_NONE | POPT_ARGFLAG_ONEDASH, &secret_mode, 's',
+	{ "secret-mode", 's', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_NONE, &secret_mode,
 	  N_("Run in secret mode"), NULL },
-	{ NULL, '\0', 0, NULL, '\0', NULL, NULL }
+	{ NULL, '\0', 0, 0, NULL, NULL, NULL }
 };
 
 
@@ -3988,15 +3988,17 @@
 	gboolean daemonize = TRUE;
 	GnomeProgram *program;
 	GnomeClient *client;
+	GOptionContext *ctx;
 	
 	bindtextdomain (PACKAGE, GNOMELOCALEDIR);
 	bind_textdomain_codeset (PACKAGE, "UTF-8");
 	textdomain (PACKAGE);
 	
+	ctx = g_option_context_new (PACKAGE);
+	g_option_context_add_main_entries (ctx, options, NULL);
+	
 	program = gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE, argc, argv,
-				      GNOME_PARAM_POPT_FLAGS, POPT_CONTEXT_POSIXMEHARDER,
-				      GNOME_PARAM_POPT_TABLE, options,
-				      GNOME_PARAM_NONE);
+				      GNOME_PARAM_GOPTION_CONTEXT, ctx, GNOME_PARAM_NONE);
 	
 	if (print_version) {
 		fprintf (stdout, "%s version %s\n", PACKAGE, VERSION);
@@ -4016,7 +4018,7 @@
 		daemonize = FALSE;
 	
 	if (secret_mode)
-		fprintf (stdout, "Managing volumes since the summer of '89\n");
+		fprintf (stdout, "Run silent, run deep.\n");
 	
 	if (daemonize && daemon (0, 0) < 0) {
 		warn ("daemonizing failed: %s", g_strerror (errno));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]