chickadee » commands » define-command

define-command name help proc #!key (handle-help? #t)procedure

Define a command named after name (symbol). This basically creates an instance of a command record and adds it the internal data structure which is returned by the commands procedure.

help is the help message to be used when the command is invoked with one of the help options given as argument (see the help-options parameter), in case handle-help? is #t.

proc is a one-argument procedure which will be given the list of command line arguments given to the command.

By default, commands defined with define-command will implicitly handle help options, printing help and exiting 0 in case one of the help-options is given as argument. The handling of help options can be disabled by binding the handle-help? keyword parameter to #f.