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 697652 - Help options generated even when help disabled
Help options generated even when help disabled
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.36.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-04-09 16:24 UTC by Marek Kašík
Modified: 2013-04-12 15:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
don't show help options when help is disabled (2.11 KB, patch)
2013-04-09 16:24 UTC, Marek Kašík
committed Details | Review
add test for disabled help options (3.50 KB, patch)
2013-04-10 11:53 UTC, Marek Kašík
committed Details | Review

Description Marek Kašík 2013-04-09 16:24:30 UTC
Created attachment 241075 [details] [review]
don't show help options when help is disabled

Function "g_option_context_get_help()" appends help options (--help-all, ...) to the resulting string even if help was disabled before by "g_option_context_set_help_enabled(.., FALSE)".

Attached patch fixes this.

This is problem in vinagre for example. It shows several help options but just 2 of them works (those which are explicitly added to the GOptionContext). The rest can not be parsed by "g_option_context_parse()" because they were disabled.

Marek
Comment 1 Matthias Clasen 2013-04-10 10:51:19 UTC
Review of attachment 241075 [details] [review]:

Looks good. Thanks for writing the patch !
It would be great if we could add a testcase to glib/tests/option-context.c that fails without this fix.
Comment 2 Marek Kašík 2013-04-10 11:53:52 UTC
Created attachment 241139 [details] [review]
add test for disabled help options

(In reply to comment #1)
> Review of attachment 241075 [details] [review]:
> 
> Looks good. Thanks for writing the patch !
> It would be great if we could add a testcase to glib/tests/option-context.c
> that fails without this fix.

Thanks. Can I commit the fix to 3.8 or do you thing that this is just for master?

Attached is a test case which fails if the fix is not applied.
Comment 3 Matthias Clasen 2013-04-12 14:58:43 UTC
Review of attachment 241075 [details] [review]:

.
Comment 4 Matthias Clasen 2013-04-12 14:58:57 UTC
Review of attachment 241139 [details] [review]:

looks good
Comment 5 Marek Kašík 2013-04-12 15:07:43 UTC
Thank you for your reviews, I've pushed them both to glib-2-36 and master.

Marke