Index: capplets/background/gnome-wp-capplet.c
===================================================================
RCS file: /cvs/gnome/gnome-control-center/capplets/background/gnome-wp-capplet.c,v
retrieving revision 1.43
diff -u -r1.43 gnome-wp-capplet.c
--- capplets/background/gnome-wp-capplet.c	11 Feb 2006 06:28:53 -0000	1.43
+++ capplets/background/gnome-wp-capplet.c	9 Aug 2006 05:37:01 -0000
@@ -35,6 +35,13 @@
   /*  { "x-special/gnome-reset-background", 0, TARGET_BACKGROUND_RESET }*/
 };
 
+static char **command_line_files = NULL;
+
+static const GOptionEntry options[] = {
+  { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &command_line_files, NULL,  N_("[FILE...]") },
+  { NULL }
+};
+
 static void wp_props_load_wallpaper (gchar * key,
 				     GnomeWPItem * item,
 				     GnomeWPCapplet * capplet);
@@ -851,7 +858,7 @@
   gtk_file_chooser_set_preview_widget_active (chooser, TRUE);
 }
   
-static void wallpaper_properties_init (poptContext ctx) {
+static void wallpaper_properties_init () {
   GnomeWPCapplet * capplet;
   GladeXML * dialog;
   GtkWidget * menu;
@@ -862,7 +869,6 @@
   GtkTreeSelection * selection;
   GdkPixbuf * pixbuf;
   GdkCursor * cursor;
-  const gchar ** args;
   GtkIconInfo * icon_info = NULL;
   GtkFileFilter *filter;
 
@@ -1052,17 +1058,14 @@
   gdk_window_set_cursor (capplet->window->window, cursor);
   gdk_cursor_unref (cursor);
 
-  args = poptGetArgs (ctx);
-  if (args != NULL) {
+  if (command_line_files != NULL) {
     const gchar ** p;
 
-    for (p = args; *p != NULL; p++) {
+    for (p = (const gchar **) command_line_files; *p != NULL; p++) {
       capplet->uri_list = g_slist_append (capplet->uri_list, (gchar *) *p);
     }
   }
 
-  poptFreeContext (ctx);
-
   g_idle_add (gnome_wp_load_stuffs, capplet);
 
   selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (capplet->treeview));
@@ -1154,24 +1157,25 @@
 
 gint main (gint argc, gchar *argv[]) {
   GnomeProgram * program;
-  GValue context = { 0 };
-  poptContext ctx;
+  GOptionContext *ctx;
+
+  ctx = g_option_context_new (_("- Desktop Background Properties"));
 
 #ifdef ENABLE_NLS
   bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
   textdomain (GETTEXT_PACKAGE);
+  g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE);
+#else
+  g_option_context_add_main_entries (ctx, options, NULL);
 #endif
 
-  program = gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE,
-				argc, argv, GNOME_PARAM_POPT_TABLE,
-				NULL, NULL);
-
-  g_object_get_property (G_OBJECT (program), GNOME_PARAM_POPT_CONTEXT,
-			 g_value_init (&context, G_TYPE_POINTER));
-  ctx = g_value_get_pointer (&context);
+  program = gnome_program_init ("gnome-background-properties", VERSION, 
+		  		LIBGNOMEUI_MODULE, argc, argv,
+				GNOME_PARAM_GOPTION_CONTEXT, ctx,
+				GNOME_PARAM_NONE);
 
-  wallpaper_properties_init (ctx);
+  wallpaper_properties_init ();
 
   gtk_main ();
   
Index: capplets/common/capplet-util.c
===================================================================
RCS file: /cvs/gnome/gnome-control-center/capplets/common/capplet-util.c,v
retrieving revision 1.44
diff -u -r1.44 capplet-util.c
--- capplets/common/capplet-util.c	27 Jul 2005 09:58:54 -0000	1.44
+++ capplets/common/capplet-util.c	9 Aug 2006 05:37:02 -0000
@@ -231,25 +231,29 @@
 {
 	gchar                         *factory_iid;
 	BonoboGenericFactory          *factory;
+	GOptionContext                *context;
 
 	static gboolean apply_only;
 	static gboolean get_legacy;
-	static struct poptOption cap_options[] = {
-		{ "apply", '\0', POPT_ARG_NONE, &apply_only, 0,
+	static GOptionEntry cap_options[] = {
+		{ "apply", 0, 0, G_OPTION_ARG_NONE, &apply_only,
 		  N_("Just apply settings and quit"), NULL },
-		{ "init-session-settings", '\0', POPT_ARG_NONE, &apply_only, 0,
+		{ "init-session-settings", 0, 0, G_OPTION_ARG_NONE, &apply_only,
 		  N_("Just apply settings and quit"), NULL },
-		{ "get-legacy", '\0', POPT_ARG_NONE, &get_legacy, 0,
+		{ "get-legacy", 0, 0, G_OPTION_ARG_NONE, &get_legacy,
 		  N_("Retrieve and store legacy settings"), NULL },
-		{ NULL, '\0', 0, NULL, 0, NULL, NULL }
+		{ NULL }
 	};
 
 	bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
 	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 	textdomain (GETTEXT_PACKAGE);
 
+	context = g_option_context_new (NULL);
+	g_option_context_add_main_entries (context, cap_options, GETTEXT_PACKAGE);
+
 	gnome_program_init (argv[0], VERSION, LIBGNOMEUI_MODULE, argc, argv,
-			    GNOME_PARAM_POPT_TABLE, cap_options,
+			    GNOME_PARAM_GOPTION_CONTEXT, context,
 			    NULL);
 
 	if (!bonobo_init (&argc, argv))
Index: capplets/keyboard/gnome-keyboard-properties.c
===================================================================
RCS file: /cvs/gnome/gnome-control-center/capplets/keyboard/gnome-keyboard-properties.c,v
retrieving revision 1.43
diff -u -r1.43 gnome-keyboard-properties.c
--- capplets/keyboard/gnome-keyboard-properties.c	26 Jan 2006 18:27:49 -0000	1.43
+++ capplets/keyboard/gnome-keyboard-properties.c	9 Aug 2006 05:37:02 -0000
@@ -211,29 +211,33 @@
 	GConfClient    *client;
 	GConfChangeSet *changeset;
 	GladeXML       *dialog;
+	GOptionContext *context;
 
 	static gboolean apply_only = FALSE;
 	static gboolean get_legacy = FALSE;
 	static gboolean switch_to_typing_break_page = FALSE;
 
-	static struct poptOption cap_options[] = {
-		{ "apply", '\0', POPT_ARG_NONE, &apply_only, 0,
+	static GOptionEntry cap_options[] = {
+		{ "apply", 0, 0, G_OPTION_ARG_NONE, &apply_only,
 		  N_("Just apply settings and quit (compatibility only; now handled by daemon)"), NULL },
-		{ "init-session-settings", '\0', POPT_ARG_NONE, &apply_only, 0,
+		{ "init-session-settings", 0, 0, G_OPTION_ARG_NONE, &apply_only,
 		  N_("Just apply settings and quit (compatibility only; now handled by daemon)"), NULL },
-		{ "get-legacy", '\0', POPT_ARG_NONE, &get_legacy, 0,
+		{ "get-legacy", 0, 0, G_OPTION_ARG_NONE, &get_legacy,
 		  N_("Retrieve and store legacy settings"), NULL },
-		{ "typing-break", '\0', POPT_ARG_NONE, &switch_to_typing_break_page, 0,
+		{ "typing-break", 0, 0, G_OPTION_ARG_NONE, &switch_to_typing_break_page,
 		  N_("Start the page with the typing break settings showing"), NULL },
-		{ NULL, '\0', 0, NULL, 0, NULL, NULL }
+		{ NULL }
 	};
 
 	bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
 	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 	textdomain (GETTEXT_PACKAGE);
 
+	context = g_option_context_new (_("- GNOME Keyboard Properties"));
+	g_option_context_add_main_entries (context, cap_options, GETTEXT_PACKAGE);
+
 	gnome_program_init ("gnome-keyboard-properties", VERSION, LIBGNOMEUI_MODULE, argc, argv,
-			    GNOME_PARAM_POPT_TABLE, cap_options,
+			    GNOME_PARAM_GOPTION_CONTEXT, context,
 			    GNOME_PARAM_APP_DATADIR, GNOMECC_DATA_DIR,
 			    NULL);
 
Index: capplets/mouse/gnome-mouse-properties.c
===================================================================
RCS file: /cvs/gnome/gnome-control-center/capplets/mouse/gnome-mouse-properties.c,v
retrieving revision 1.71
diff -u -r1.71 gnome-mouse-properties.c
--- capplets/mouse/gnome-mouse-properties.c	24 Jul 2006 12:38:02 -0000	1.71
+++ capplets/mouse/gnome-mouse-properties.c	9 Aug 2006 05:37:03 -0000
@@ -1020,21 +1020,25 @@
 	GConfChangeSet *changeset;
 	GladeXML       *dialog;
 	GtkWidget      *dialog_win;
+	GOptionContext *context;
 
 	static gboolean get_legacy;
-	static struct poptOption cap_options[] = {
-		{ "get-legacy", '\0', POPT_ARG_NONE, &get_legacy, 0,
+	static GOptionEntry cap_options[] = {
+		{ "get-legacy", 0, 0, G_OPTION_ARG_NONE, &get_legacy,
 		  N_("Retrieve and store legacy settings"), NULL },
-		{ NULL, '\0', 0, NULL, 0, NULL, NULL }
+		{ NULL }
 	};
 
 	bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
 	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 	textdomain (GETTEXT_PACKAGE);
 
+	context = g_option_context_new (_("- GNOME Mouse Properties"));
+	g_option_context_add_main_entries (context, cap_options, GETTEXT_PACKAGE);
+
 	gnome_program_init ("gnome-mouse-properties", VERSION,
 			    LIBGNOMEUI_MODULE, argc, argv,
-			    GNOME_PARAM_POPT_TABLE, cap_options,
+			    GNOME_PARAM_GOPTION_CONTEXT, context,
 			    GNOME_PARAM_APP_DATADIR, GNOMECC_DATA_DIR,
 			    NULL);
 
Index: capplets/sound/sound-properties-capplet.c
===================================================================
RCS file: /cvs/gnome/gnome-control-center/capplets/sound/sound-properties-capplet.c,v
retrieving revision 1.51
diff -u -r1.51 sound-properties-capplet.c
--- capplets/sound/sound-properties-capplet.c	2 Aug 2006 11:10:16 -0000	1.51
+++ capplets/sound/sound-properties-capplet.c	9 Aug 2006 05:37:04 -0000
@@ -749,29 +749,33 @@
 {
 	GConfChangeSet *changeset;
 	GladeXML       *dialog = NULL;
+ 	GOptionContext *context;
 
 	static gboolean apply_only;
 	static gboolean get_legacy;
-	static struct poptOption cap_options[] = {
-		{ "apply", '\0', POPT_ARG_NONE, &apply_only, 0,
+ 	static GOptionEntry cap_options[] = {
+ 		{ "apply", 0, 0, G_OPTION_ARG_NONE, &apply_only,
 		  N_("Just apply settings and quit (compatibility only; now handled by daemon)"), NULL },
-		{ "init-session-settings", '\0', POPT_ARG_NONE, &apply_only, 0,
+		{ "init-session-settings", 0, 0, G_OPTION_ARG_NONE, &apply_only,
 		  N_("Just apply settings and quit (compatibility only; now handled by daemon)"), NULL },
-		{ "get-legacy", '\0', POPT_ARG_NONE, &get_legacy, 0,
+ 		{ "get-legacy", 0, 0, G_OPTION_ARG_NONE, &get_legacy,
 		  N_("Retrieve and store legacy settings"), NULL },
-		{ NULL, '\0', 0, NULL, 0, NULL, NULL }
+ 		{ NULL }
 	};
 
 	bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
 	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 	textdomain (GETTEXT_PACKAGE);
 
-	gst_init (&argc, &argv);
+ 	context = g_option_context_new (_("- GNOME Sound Properties"));
+ 	g_option_context_add_main_entries (context, cap_options, GETTEXT_PACKAGE);
 
 	gnome_program_init ("gnome-sound-properties", VERSION,
 			    LIBGNOMEUI_MODULE, argc, argv,
-			    GNOME_PARAM_POPT_TABLE, cap_options,
+ 			    GNOME_PARAM_GOPTION_CONTEXT, context,
 			    NULL);
+
+	gst_init (&argc, &argv);
 
 	activate_settings_daemon ();
 	
Index: vfs-methods/themus/themus-theme-applier.c
===================================================================
RCS file: /cvs/gnome/gnome-control-center/vfs-methods/themus/themus-theme-applier.c,v
retrieving revision 1.6
diff -u -r1.6 themus-theme-applier.c
--- vfs-methods/themus/themus-theme-applier.c	22 May 2005 15:46:45 -0000	1.6
+++ vfs-methods/themus/themus-theme-applier.c	9 Aug 2006 05:37:06 -0000
@@ -31,6 +31,13 @@
 
 #define FONT_KEY           "/desktop/gnome/interface/font_name"
 
+static char **arguments = NULL;
+
+static const GOptionEntry options[] = {
+	{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &arguments, NULL, N_("[FILE...]") },
+	{NULL}
+};
+
 int main (int argc, char **argv)
 {
 	GnomeVFSURI *uri;
@@ -40,22 +47,23 @@
 	GtkWidget *font_dialog;
 	GtkWidget *font_sample;
 	gboolean apply_font = FALSE;
-	poptContext ctx;
-	gchar **args;
+	GOptionContext *context;
+
+	context = g_option_context_new(_("- GNOME Theme Applier"));
+	g_option_context_add_main_entries(context, options, NULL);
 
 	gtk_init (&argc, &argv);
-	program = gnome_program_init ("ThemeApplier", "0.3.0", LIBGNOME_MODULE,
-				      argc, argv, GNOME_PARAM_NONE);
+	program = gnome_program_init ("themus-theme-applier", "0.3.0", LIBGNOME_MODULE,
+				      argc, argv,
+				      GNOME_PARAM_GOPTION_CONTEXT, context,
+				      GNOME_PARAM_NONE);
 	
-	g_object_get (program, GNOME_PARAM_POPT_CONTEXT, &ctx, NULL);
-	args = (char**) poptGetArgs(ctx);
-
-	if (!args) return 1;
+	if (!arguments) return 1;
 
 	gnome_vfs_init ();
 	gnome_theme_init (NULL);
 		
-	uri = gnome_vfs_uri_new (args[0]);
+	uri = gnome_vfs_uri_new (arguments[0]);
 	g_assert (uri != NULL);
 		
 	theme = gnome_theme_read_meta_theme (uri);
