added
[rrq/newlisp/packnl.git] / main-args.lsp.8.adoc
1 = main-args.lsp(8)
2 :doctype: manpage
3 :revdate: {sys:date "+%Y-%m-%d %H:%M:%S"}
4
5 == NAME
6
7 main-args.lsp - a newlisp module for simple main-args processing
8
9 == SYNOPSIS
10
11 ====
12 (*constant* '*OPTIONS* ( _MATCH_* ) ) +
13 (*load* "main-arg.lsp")
14 ====
15
16 == DESCRIPTION
17
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.
22
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.
27
28 The _OPTIONS_ constant is reassigned with the actual command line
29 options and values.
30
31 === main-args.lsp API
32
33 *ARGS*::
34
35 This variable holds any remaining command line arguments when options
36 have been matched.
37
38 *OPTIONS*::
39
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.
43
44 == EXAMPLE
45
46 .The following example is from _packnl_
47 ----
48 (constant 'OPTIONS
49     '(("-w" ?)   ; write new file
50       ("-u" ? ?) ; unpack members to given directory
51       ("-t" ?)   ; merely list packed members of
52       ))
53 (load "main-args.lsp")
54 ----
55
56 == SEE ALSO
57
58 *newlisp*
59
60 == AUTHOR
61
62 Ralph.Ronnquist <ralph.ronnquist@gmail.com>