### Method

# GLib OptionContext get_help

since: 2.14

#### Declaration

    gchar*
    g_option_context_get_help (
      GOptionContext* context,
      gboolean main_help,
      GOptionGroup* group
    )

#### Description

Returns a formatted, translated help text for the given context. To obtain the text produced by `--help`, call `g_option_context_get_help (context, TRUE, NULL)`. To obtain the text produced by `--help-all`, call `g_option_context_get_help (context, FALSE, NULL)`. To obtain the help text for an option group, call `g_option_context_get_help (context, FALSE, group)`.

Available since: 2.14

#### Parameters

`main_help`

  Type: `gboolean`

  If `TRUE`, only include the main group.

`group`

  Type: `GOptionGroup`

  The `GOptionGroup` to create help for, or `NULL`.

  The argument can be `NULL`.
  The data is owned by the caller of the method.

#### Return value

Type: `gchar*`

A newly allocated string containing the help text.

The caller of the method takes ownership of the data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.