The following definitions are allowed on top of the parameter definitions. All of them are optional. They may appear in any order.
#include <file.h>. Ignored in languages other than C and C++. Only 1 include statement per line.
#mandatory x. Use multiple
#mandatorystatements in order to specify multiple mandatory parameters. Only 1
#mandatorystatement per line. Note that Genparse does not check for mandatory parameters, they are only printed in the
usage ()function with the
__MANDATORIES__directive (See __MANDATORIES__.). Deprecated: add mandatory parameters in the #usage section instead.
#break_linesdirective is specified then lines will be printed exactly as given in the genparse file. Note that genparse doesn’t know the width of macros included from other files, so automatic line breaking will probably not work properly if for example
__STRING__macros (See __STRING__.) are used. Lines can still be broken manually using the
__NL__macro (See __NL__.) in places where Genparse doesn’t break lines as expected.
#no_structis specified then no struct will be defined which will be filled with the command line parameters in the generated parser. This may be useful if you want to add your own code with
__CODE__statements instead (See __CODE__.) Only supported for C output.
#export_long_optionsis defined then a function
get_long_options ()is added which exports the longoptions array used by
getopt_long (). This directive is only available for C output, for other languages it is ignored.
my_callback (). Only 1 global callback function is allowed.