Merge branch '3007-option-context-colons' into 'main'

goption: Clarify expected format of option group description in docs

Closes #3007

See merge request GNOME/glib!3481
This commit is contained in:
Marco Trevisan 2023-06-29 17:00:49 +00:00
commit 39e018e151
2 changed files with 6 additions and 1 deletions

View File

@ -503,7 +503,7 @@ g_application_parse_command_line (GApplication *application,
g_option_context_set_description (context, application->priv->description);
gapplication_group = g_option_group_new ("gapplication",
_("GApplication options"), _("Show GApplication options"),
_("GApplication Options:"), _("Show GApplication options"),
NULL, NULL);
g_option_group_set_translation_domain (gapplication_group, GETTEXT_PACKAGE);
g_option_context_add_group (context, gapplication_group);

View File

@ -2297,6 +2297,11 @@ g_option_context_parse (GOptionContext *context,
*
* Creates a new #GOptionGroup.
*
* @description is typically used to provide a title for the group. If so, it
* is recommended that its written in title case, and has a trailing colon so
* that it matches the style of built-in GLib group titles such as
* Application Options:.
*
* Returns: a newly created option group. It should be added
* to a #GOptionContext or freed with g_option_group_unref().
*