:- use_module(library(optparse)).(can be autoloaded)
Opts is a list of parsed options in the form Key(Value),
or (with the option
functor(Func) given) in the form
Func(Key, Value). Dashed args not in OptsSpec are not
permitted and will raise error (see tip on how to pass unknown flags in
the module description).
PositionalArgs are the remaining non-dashed args after each
flag has taken its argument (filling in
for booleans). There are no restrictions on non-dashed arguments and
they may go anywhere (although it is good practice to put them last).
- Set the functor Func of the returned options Func(Key,Value). Default is the special value’OPTION' (upper-case), which makes the returned options have form Key(Value).
- Controls how to handle options given more than once on the commad line.
Keep is one of
keepfirst, keeplast, keepallwith the obvious meaning. Default is
- If true (default), a flag specification is not required (it is allowed
that both shortflags and longflags be either
or absent). Flagless options cannot be manipulated from the command line and will not show up in the generated help. This is useful when you have (also) general configuration parameters in your OptsSpec, especially if you think they one day might need to be controlled externally. See example in the module overview.
allow_empty_flag_spec(false)gives the more customary behaviour of raising error on empty flags.