Don't print help options if the options of a specific group have been

2004-12-09  Matthias Clasen  <mclasen@redhat.com>

	* glib/goption.c (print_help): Don't print help options
	if the options of a specific group have been
	requested.  (#160645, Glynn Foster)
This commit is contained in:
Matthias Clasen 2004-12-09 14:38:13 +00:00 committed by Matthias Clasen
parent 10632e416f
commit 4f402e2489
6 changed files with 49 additions and 16 deletions

View File

@ -1,3 +1,9 @@
2004-12-09 Matthias Clasen <mclasen@redhat.com>
* glib/goption.c (print_help): Don't print help options
if the options of a specific group have been
requested. (#160645, Glynn Foster)
2004-12-07 Matthias Clasen <mclasen@redhat.com> 2004-12-07 Matthias Clasen <mclasen@redhat.com>
* glib/gutils.c (g_get_language_names): Update the returned * glib/gutils.c (g_get_language_names): Update the returned

View File

@ -1,3 +1,9 @@
2004-12-09 Matthias Clasen <mclasen@redhat.com>
* glib/goption.c (print_help): Don't print help options
if the options of a specific group have been
requested. (#160645, Glynn Foster)
2004-12-07 Matthias Clasen <mclasen@redhat.com> 2004-12-07 Matthias Clasen <mclasen@redhat.com>
* glib/gutils.c (g_get_language_names): Update the returned * glib/gutils.c (g_get_language_names): Update the returned

View File

@ -1,3 +1,9 @@
2004-12-09 Matthias Clasen <mclasen@redhat.com>
* glib/goption.c (print_help): Don't print help options
if the options of a specific group have been
requested. (#160645, Glynn Foster)
2004-12-07 Matthias Clasen <mclasen@redhat.com> 2004-12-07 Matthias Clasen <mclasen@redhat.com>
* glib/gutils.c (g_get_language_names): Update the returned * glib/gutils.c (g_get_language_names): Update the returned

View File

@ -1,3 +1,9 @@
2004-12-09 Matthias Clasen <mclasen@redhat.com>
* glib/goption.c (print_help): Don't print help options
if the options of a specific group have been
requested. (#160645, Glynn Foster)
2004-12-07 Matthias Clasen <mclasen@redhat.com> 2004-12-07 Matthias Clasen <mclasen@redhat.com>
* glib/gutils.c (g_get_language_names): Update the returned * glib/gutils.c (g_get_language_names): Update the returned

View File

@ -1,3 +1,9 @@
2004-12-09 Matthias Clasen <mclasen@redhat.com>
* glib/goption.c (print_help): Don't print help options
if the options of a specific group have been
requested. (#160645, Glynn Foster)
2004-12-07 Matthias Clasen <mclasen@redhat.com> 2004-12-07 Matthias Clasen <mclasen@redhat.com>
* glib/gutils.c (g_get_language_names): Update the returned * glib/gutils.c (g_get_language_names): Update the returned

View File

@ -482,26 +482,29 @@ print_help (GOptionContext *context,
/* Add a bit of padding */ /* Add a bit of padding */
max_length += 4; max_length += 4;
list = context->groups;
g_print ("%s\n --%-*s %s\n", if (!group)
_("Help Options:"), max_length, "help", _("Show help options"));
/* We only want --help-all when there are groups */
if (list)
g_print (" --%-*s %s\n", max_length, "help-all", _("Show all help options"));
while (list)
{ {
GOptionGroup *group = list->data; list = context->groups;
g_print (" --help-%-*s %s\n", max_length - 5, group->name, TRANSLATE (group, group->help_description));
list = list->next; g_print ("%s\n --%-*s %s\n",
} _("Help Options:"), max_length, "help", _("Show help options"));
/* We only want --help-all when there are groups */
if (list)
g_print (" --%-*s %s\n", max_length, "help-all", _("Show all help options"));
g_print ("\n"); while (list)
{
GOptionGroup *group = list->data;
g_print (" --help-%-*s %s\n", max_length - 5, group->name, TRANSLATE (group, group->help_description));
list = list->next;
}
g_print ("\n");
}
if (group) if (group)
{ {