--- a/gflib/gflib/gf_core.c Sun Aug 02 19:37:42 2009 -0500
+++ b/gflib/gflib/gf_core.c Sun Aug 02 23:51:04 2009 -0500
@@ -55,7 +55,7 @@
*****************************************************************************/
static gchar *prefs_uri = NULL;
-static GOptionEntry entries[] = {
+static GOptionEntry gflib_args[] = { "prefs-uri", 0, 0, G_OPTION_ARG_STRING, &prefs_uri,
"The uri describing the preference engine and options.",
@@ -82,24 +82,6 @@
-parse_arguments(gint *argc, gchar ***argv) {
- GOptionContext *ctx = NULL;
- ctx = g_option_context_new(NULL);
- g_option_context_add_main_entries(ctx, entries, GETTEXT_PACKAGE);
- g_option_context_parse(ctx, argc, argv, &err);
- g_option_context_free(ctx);
- fprintf(stderr, "%s\n", err->message);
/******************************************************************************
*****************************************************************************/
@@ -131,9 +113,6 @@
/* Initialize the GType system */
- /* setup our command line arguments */
- parse_arguments(argc, argv);
/* setup the system log */
@@ -229,3 +208,27 @@
+ * Returns a #GOptionGroup for the commandline arguments recognized by gflib. + * You should add this group to your #GOptionContext with + * g_option_context_add_group(), if you are using g_option_context_parse() to + * parse your commandline arguments. + * Returns: A #GOptionGroup for the command line arguments recognized by gflib. +gf_get_option_group(void) { + GOptionGroup *group = NULL; + group = g_option_group_new("gflib", _("GfLib Options"), + _("Show gflib options"), NULL, NULL); + g_option_group_add_entries(group, gflib_args); + g_option_group_set_translation_domain(group, GETTEXT_PACKAGE); --- a/gflib/gflib/gf_core.h Sun Aug 02 19:37:42 2009 -0500
+++ b/gflib/gflib/gf_core.h Sun Aug 02 23:51:04 2009 -0500
@@ -31,6 +31,8 @@
const gchar *gf_lib_get_lib_version(void);
const gchar *gf_lib_get_website(void);
+GOptionGroup *gf_get_option_group(void);