Pass the option name also in the NO_ARG case. (#308602, Masatake YAMATO)
authorMatthias Clasen <mclasen@redhat.com>
Wed, 22 Jun 2005 16:24:22 +0000 (16:24 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 22 Jun 2005 16:24:22 +0000 (16:24 +0000)
2005-06-22  Matthias Clasen  <mclasen@redhat.com>

* glib/goption.c (parse_short_option, parse_long_option):
Pass the option name also in the NO_ARG case.  (#308602,
Masatake YAMATO)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-8
glib/goption.c

index 19902d7..8946716 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-06-22  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/goption.c (parse_short_option, parse_long_option): 
+       Pass the option name also in the NO_ARG case.  (#308602,
+       Masatake YAMATO)
+       
 2005-06-22  Tor Lillqvist  <tml@novell.com>
 
        * glib/gfileutils.c (g_makepath): New function. Creates a
index 19902d7..8946716 100644 (file)
@@ -1,3 +1,9 @@
+2005-06-22  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/goption.c (parse_short_option, parse_long_option): 
+       Pass the option name also in the NO_ARG case.  (#308602,
+       Masatake YAMATO)
+       
 2005-06-22  Tor Lillqvist  <tml@novell.com>
 
        * glib/gfileutils.c (g_makepath): New function. Creates a
index 19902d7..8946716 100644 (file)
@@ -1,3 +1,9 @@
+2005-06-22  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/goption.c (parse_short_option, parse_long_option): 
+       Pass the option name also in the NO_ARG case.  (#308602,
+       Masatake YAMATO)
+       
 2005-06-22  Tor Lillqvist  <tml@novell.com>
 
        * glib/gfileutils.c (g_makepath): New function. Creates a
index 19902d7..8946716 100644 (file)
@@ -1,3 +1,9 @@
+2005-06-22  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/goption.c (parse_short_option, parse_long_option): 
+       Pass the option name also in the NO_ARG case.  (#308602,
+       Masatake YAMATO)
+       
 2005-06-22  Tor Lillqvist  <tml@novell.com>
 
        * glib/gfileutils.c (g_makepath): New function. Creates a
index 78a66c7..a432aca 100644 (file)
@@ -904,8 +904,13 @@ parse_short_option (GOptionContext *context,
        {
          if (NO_ARG (&group->entries[j]))
            {
+             gchar *option_name;
+
+             option_name = g_strdup_printf ("-%c", group->entries[j].short_name);
              parse_arg (context, group, &group->entries[j],
-                        NULL, NULL, error);
+                        NULL, option_name, error);
+             g_free (option_name);
+             
              *parsed = TRUE;
            }
          else
@@ -972,8 +977,12 @@ parse_long_option (GOptionContext *context,
       if (NO_ARG (&group->entries[j]) &&
          strcmp (arg, group->entries[j].long_name) == 0)
        {
+         gchar *option_name;
+
+         option_name = g_strconcat ("--", group->entries[j].long_name, NULL);
          parse_arg (context, group, &group->entries[j],
-                    NULL, NULL, error);
+                    NULL, option_name, error);
+         g_free(option_name);
          
          add_pending_null (context, &((*argv)[*index]), NULL);
          *parsed = TRUE;