A lambda-list of option arguments.
The documentation of the option (a string).
The option function.
A list of option keys.
RETURN: The list of options defined.
PARSE-OPTIONS (ARGUMENTS &OPTIONAL DEFAULT UNDEFINED-ARGUMENT)
DO: Parse the options in the ARGUMENTS list. DEFAULT: Thunk called if ARGUMENTS is empty. UNDEFINED-ARGUMENT: Thunk called if an undefined option is present in the ARGUMENTS.
Signals the PARSE-OPTIONS-FINISH condition, which terminates option parsing early.
This function can be used to set *program-name* in the main script (setf script:*program-name* (script:pname))
SETFOPTION-ARGUMENTS (NEW-VALUE INSTANCE)
SETFOPTION-DOCUMENTATION (NEW-VALUE INSTANCE)
SETFOPTION-FUNCTION (NEW-VALUE INSTANCE)
SETFOPTION-KEYS (NEW-VALUE INSTANCE)
Q&D-ARGUMENTS (MANDATORIES OPTIONALS REST KEYS)
BUG: when the optionals or keys have a present indicator, we just ignore it and build a list that will pass the default value anyways...
Parses (mandatory &optional optionals... &rest rest &key key...)
MAKE-OPTION (&KEY ((KEYS DUM12) NIL) ((ARGUMENTS DUM13) NIL) ((DOCUMENTATION DUM14) NIL) ((FUNCTION DUM15) NIL))
WRAP-OPTION-FUNCTION (KEYS OPTION-ARGUMENTS DOCSTRING OPTION-FUNCTION)
DEFINE-OPTION (NAMES PARAMETERS &BODY BODY)
DO: Define a new option for the scirpt. NAMES: A list designator of option names (strings such as "-a" "--always"). PARAMETERS: A list of option parameters. The names of these parameters must be descriptive as they are used to build the usage help text. BODY: The code implementing this option. RETURN: The lisp-name of the option (this is a symbol named for the first option name).
REDIRECTING-STDOUT-TO-STDERR (&BODY BODY)
Execute BODY with the *standard-output*, *error-output*, and *trace-output* redirected. If an error occurs in BODY, then all the redirected output is sent to *error-output*.
CALL-OPTION-FUNCTION (OPTION ARGUMENTS &OPTIONAL UNDEFINED-ARGUMENT)
DO: Call the option function with the ARGUMENTS. RETURN: The remaining list of arguments. UNDEFINED-ARGUMENT: A function taking an option key and the remaining list of arguments, called if an undefined argument is found in ARGUMENTS. It should return the new remaining list of arguments.
A function (lambda (index words) ...) that will print the completion and return true, or do nothing and return nil.
Errors break into the debugger.
Some general documentation text issued by the --help command.
Name of the program. If available we use the actual command line program name, otherwise we fallback to *PROGRAM-NAME*.
The dictionary of options.
An option structure.
Condition signaled to finish the parsing of options early.
base value for error messages
maximum listed value
can't create (user) output file A (user specified) output file cannot be created.
data format error The input data was incorrect in some way. This should only be used for user's data & not system files.
input/output error An error occurred while doing I/O on some file.
host name unknown The host specified did not exist. This is used in mail addresses or network requests.
cannot open input An input file (not a system file) did not exist or was not readable. This could also include errors like "No message" to a mailer (if it cared to catch it).
permission denied You did not have sufficient permission to perform the operation. This is not intended for file system problems, which should use NOINPUT or CANTCREAT, but rather for higher level permissions.
addressee unknown The user specified did not exist. This might be used for mail addresses or remote logins.
system error (e.g., can't fork) An operating system error has been detected. This is intended to be used for such things as "cannot fork", "cannot create pipe", or the like. It includes things like getuid returning a user that does not exist in the passwd file.
critical OS file missing Some system file (e.g., /etc/passwd, /etc/utmp, etc.) does not exist, cannot be opened, or has some sort of error (e.g., syntax error).
remote error in protocol the remote system returned something that was "not possible" during a protocol exchange.
internal software error An internal software error has been detected. This should be limited to non-operating system related errors as possible.
temp failure; user is invited to retry temporary failure, indicating something that is not really an error. In sendmail, this means that a mailer (e.g.) could not create a connection, and the request should be reattempted later.
command line usage error The command was used incorrectly, e.g., with the wrong number of arguments, a bad flag, a bad syntax in a parameter, or whatever.