The shell parses the command line with which Lisp is invoked, and passes a data structure containing the parsed information to Lisp. This information is then extracted from that data structure and put into a set of Lisp data structures.
The value of
*command-line-words* is a list of strings that
make up the command line, one word per string. The first word on
the command line, i.e. the name of the program invoked (usually
lisp) is stored in
*command-line-switches* is a list of
command-line-switch structures, with a structure for each
word on the command line starting with a hyphen. All the command
line words between the program name and the first switch are stored
The following functions may be used to examine
Returns the name of the switch, less the preceding hyphen and trailing equal sign (if any).
Returns the value designated using an embedded equal sign, if any. If the switch has no equal sign, then this is null.
Returns a list of the words between this switch and the next switch or the end of the command line.
Returns the first non-null value from
first element in
cmd-switch-words, or the first word in
This function takes the name of a switch as a string and returns the
value of the switch given on the command line. If no value was
specified, then any following words are returned. If there are no
following words, then
t is returned. If the switch was not
nil is returned.
This macro causes function to be called when the switch name appears in the command line. Name is a simple-string that does not begin with a hyphen (unless the switch name really does begin with one.)
If function is not supplied, then the switch is parsed into command-line-switches, but otherwise ignored. This suppresses the undefined switch warning which would otherwise take place. The warning can also be globally suppressed by complain-about-illegal-switches.