summaryrefslogtreecommitdiff
path: root/glib/goption.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2005-03-15 13:24:22 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2005-03-15 13:24:22 +0000
commit4faa0650e54089bda119a7b93045c8e21d9946a1 (patch)
tree8a04c2496b6d8c261816fdb05e2e0aae53635288 /glib/goption.c
parent3448a27829133bebb3bf1e29a30574304c899040 (diff)
downloadglib-4faa0650e54089bda119a7b93045c8e21d9946a1.tar.gz
Warn if there already is a main group. (#170445, Jeff Franks)
2005-03-15 Matthias Clasen <mclasen@redhat.com> * glib/goption.c (g_option_context_set_main_group): Warn if there already is a main group. (#170445, Jeff Franks)
Diffstat (limited to 'glib/goption.c')
-rw-r--r--glib/goption.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/glib/goption.c b/glib/goption.c
index 13104f913..a8528de36 100644
--- a/glib/goption.c
+++ b/glib/goption.c
@@ -312,6 +312,13 @@ g_option_context_set_main_group (GOptionContext *context,
g_return_if_fail (context != NULL);
g_return_if_fail (group != NULL);
+ if (context->main_group)
+ {
+ g_warning ("This GOptionContext already has a main group");
+
+ return;
+ }
+
context->main_group = group;
}