After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 431021 - Provide a getter to retrieve from a GOptionGroup the GOptionEntry it contains
Provide a getter to retrieve from a GOptionGroup the GOptionEntry it contains
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2007-04-18 14:29 UTC by Francesco Montorsi
Modified: 2018-05-24 11:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Francesco Montorsi 2007-04-18 14:29:34 UTC
I want to support standard GTK options in my program but I don't want to use g_option_ processing macros to parse command line.

Now, when I want to print the help of my program (in response to --help option, and using my own code), I need to be able to get a list of the GTK standard options processed by gtk_init.

Unfortunately gtk_get_option_group() returns a GOptionGroup* which however is completely opaque and has no getters!!

This means that there is no way for GTK users which do not use g_option_* parser facilities to get the list of GTK supported options.

A simple 

  gint g_option_group_get_entries(GOptionGroup group, GOptionEntry **p)
  {
      *p = group->entries;
      return group->n_entries;
  }

should do the job.
Comment 1 GNOME Infrastructure Team 2018-05-24 11:01:16 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/91.