3 :revdate: {sys:date "+%Y-%m-%d %H:%M:%S"}
7 main-args.lsp - a newlisp module for simple main-args processing
12 (*constant* '*OPTIONS* ( _MATCH_* ) ) +
13 (*load* "main-arg.lsp")
18 This newlisp module implements simple command line processing to
19 extract options with arguments. When loaded it processes a
20 pre-assigned _OPTIONS_ vaiable to replace its list of possible options
21 with the list of actual matches.
23 Each _MATCH_ is a _match_ pattern consisting of "option string" to
24 match and question mark symbols to mark any argument for that option.
25 For example, a _MATCH_ like _("-a" ?)_ will match against a "-a"
26 option and a subsequent option value.
28 The _OPTIONS_ constant is reassigned with the actual command line
35 This variable holds any remaining command line arguments when options
40 This variable should be set up before loading *main-args.lsp* to
41 declare which the command line options are, and it becomes replaced
42 with an association list of the actual command line options.
46 .The following example is from _packnl_
49 '(("-w" ?) ; write new file
50 ("-u" ? ?) ; unpack members to given directory
51 ("-t" ?) ; merely list packed members of
53 (load "main-args.lsp")
62 Ralph.Ronnquist <ralph.ronnquist@gmail.com>