OptionContext.this

Creates a new option context.

The parameter_string can serve multiple purposes. It can be used to add descriptions for "rest" arguments, which are not parsed by the glib.OptionContext, typically something like "FILES" or "FILE1 FILE2...". If you are using G_OPTION_REMAINING for collecting "rest" arguments, GLib handles this automatically by using the arg_description of the corresponding GOptionEntry in the usage summary.

Another usage is to give a short summary of the program functionality, like " - frob the strings", which will be displayed in the same line as the usage. For a longer description of the program functionality that should be displayed as a paragraph below the usage line, use OptionContext.setSummary.

Note that the parameter_string is translated using the function set with OptionContext.setTranslateFunc, so it should normally be passed untranslated.

  1. this(GOptionContext* gOptionContext, bool ownedRef)
  2. this(string parameterString)
    class OptionContext
    this

Parameters

parameterString string

a string which is displayed in the first line of --help output, after the usage summary programname [OPTION...]

Return Value

a newly created glib.OptionContext, which must be freed with OptionContext.free after use.

Throws

ConstructionException GTK+ fails to create the object.

Meta