= main-args.lsp(8) :doctype: manpage :revdate: {sys:date "+%Y-%m-%d %H:%M:%S"} == NAME main-args.lsp - a newlisp module for simple main-args processing == SYNOPSIS ==== (*constant* '*OPTIONS* ( _MATCH_* ) ) + (*load* "main-arg.lsp") ==== == DESCRIPTION This newlisp module implements simple command line processing to extract options with arguments. When loaded it processes a pre-assigned _OPTIONS_ vaiable to replace its list of possible options with the list of actual matches. Each _MATCH_ is a _match_ pattern consisting of "option string" to match and question mark symbols to mark any argument for that option. For example, a _MATCH_ like _("-a" ?)_ will match against a "-a" option and a subsequent option value. The _OPTIONS_ constant is reassigned with the actual command line options and values. === main-args.lsp API *ARGS*:: This variable holds any remaining command line arguments when options have been matched. *OPTIONS*:: This variable should be set up before loading *main-args.lsp* to declare which the command line options are, and it becomes replaced with an association list of the actual command line options. == EXAMPLE .The following example is from _packnl_ ---- (constant 'OPTIONS '(("-w" ?) ; write new file ("-u" ? ?) ; unpack members to given directory ("-t" ?) ; merely list packed members of )) (load "main-args.lsp") ---- == SEE ALSO *newlisp* == AUTHOR Ralph.Ronnquist