Package: glib

Function glib:option-context-new

Lambda List

glib:option-context-new (&optional parameter)

Arguments

parameter -- a string which is displayed in the first line of --help output

Return Value

The newly created g:option-context instance, which must be freed with the g:option-context-free function after use.

Details

Creates a new option context. The parameter argument can serve multiple purposes. It can be used to add descriptions for "rest" arguments, which are not parsed by the g:option-context instance, 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 parameter of the corresponding option entry 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 the g:option-context-summary function.

Note that the parameter argument is translated using the function set with the g:option-context-set-translate-func function, so it should normally be passed untranslated.

Examples

(g:option-context-new "This is an example for a description.")
=> #.(SB-SYS:INT-SAP #X0817EB48)
(g:option-context-help * nil)
=>
"Aufruf:
  sbcl [OPTION …] This is an example for a description.

Hilfeoptionen: -h, --help Hilfeoptionen anzeigen "
 

See also

2024-11-19