Next: getopts config, Previous: getopts intro, Up: getopts [Index]
Type of records representing command line options.
A Scheme character representing a dash plus single character (brief)
option selector; to specify an option with no brief selector, we can set
this field to #f
.
A Scheme string representing a long option selector, without the
double–dash prefix; to specify an option with no long selector, we can
set this field to #f
.
Boolean, true if this option requires an argument.
Scheme string describing this option, to be used in help screens.
Semantic action, a closure to be invoked when this option is found on the command line.
requires-argument?
is set to #f
: the closure
is applied to a single value being the command-line-option
record
representing the option.
requires-argument?
is set to #t
: the closure is
applied to two values being the command-line-option
record
representing the option and the Scheme string representing the option’s
value.
We have to remember that command-line-option
records can be
compared with eq?
.
Build and return a new command-line-option
record.
Return #t
if obj is a record of type
command-line-option
, otherwise return #f
.
Build a new command-line-option
record and bind it to
?name, which must be a Scheme symbol. All the ?clause
arguments must be subforms with an auxiliary syntactic keyword as first
element. Example:
(define-command-line-option interactive (brief #\i) (long "interactive") (requires-argument #f) (description "ask the user first") (action (lambda (option) ---)))
Accessors for the fields of a command-line-option
record.
Next: getopts config, Previous: getopts intro, Up: getopts [Index]