This is the cli-parser Reference Manual, version 0.1, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 12:08:57 2020 GMT+0.
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
The main system appears first, followed by any subsystem dependency.
• The cli-parser system |
Denis Bueno
Copyright (c) 2005
A command-line argument parser. Mostly parses options of the same form that getopt parses
0.1
cli-parser.asd (file)
cli-parser.lisp (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The cli-parser.asd file | ||
• The cli-parser/cli-parser.lisp file |
Next: The cli-parser/cli-parser․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
cli-parser.asd
cli-parser (system)
Previous: The cli-parser․asd file, Up: Lisp files [Contents][Index]
cli-parser (system)
cli-parser.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The cli-parser package |
Used for command-line-interface parsing, in the same tradition
as getopt, but, a bit more convenient. The three main functions
are:
* CLI-PARSE
* CLI-PARSE-HASH
* CLI-PARSE-ASSOC
CLI-PARSE actually just calls CLI-PARSE-HASH, which will parse a
list of command-line arguments against a list of CLI-OPTION
objects. CLI-PARSE-ASSOC, instead of returning a hash table of
results like CLI-PARSE-HASH does, returns an assoc list of
results.
The idea is that you create a bunch of cli-option instances (via MAKE-CLI-OPTION) which represent all of the valid options the user may pass in to your program. The actual options passed in (as a list of strings, one for each option) along with the list of valid options are passed to cli-parse, which will give you a table of mappings, from the option to the setting specified by the user.
cli-parser.lisp (file)
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported functions | ||
• Exported generic functions | ||
• Exported classes |
Next: Exported generic functions, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
cli-parser.lisp (file)
See CLI-PARSE-HASH.
cli-parser.lisp (file)
Parses command-line arguments much in the same format as the cl-args that getopt() parses. That is, if you call any program with: ’./prgm –opt1=value1 value2 -n’, and you give "–opt1=value1", "value2" and "-n" to cli-parse-assoc, it returns and assoc-list of the form (("opt1" ("value1" "value2")) ("n" nil)).
cli-parser.lisp (file)
Parses command-line arguments in the same form as specified for CLI-PARSE-ASSOC, but returns a hash-table of the results, instead of an assoc list.
cli-parser.lisp (file)
Print the command line usage
cli-parser.lisp (file)
Next: Exported classes, Previous: Exported functions, Up: Exported definitions [Contents][Index]
automatically generated reader method
cli-parser.lisp (file)
automatically generated writer method
cli-parser.lisp (file)
automatically generated reader method
cli-parser.lisp (file)
automatically generated writer method
cli-parser.lisp (file)
automatically generated reader method
cli-parser.lisp (file)
automatically generated writer method
cli-parser.lisp (file)
automatically generated reader method
cli-parser.lisp (file)
automatically generated writer method
cli-parser.lisp (file)
automatically generated reader method
cli-parser.lisp (file)
automatically generated writer method
cli-parser.lisp (file)
Previous: Exported generic functions, Up: Exported definitions [Contents][Index]
cli-parser.lisp (file)
standard-object (class)
(or null string)
:abbr
cli-option-abbr (generic function)
(setf cli-option-abbr) (generic function)
string
:full
cli-option-full (generic function)
(setf cli-option-full) (generic function)
(member nil t :optional)
:requires-arguments
cli-option-requires-arguments (generic function)
(setf cli-option-requires-arguments) (generic function)
string
:description
"default description."
cli-option-description (generic function)
(setf cli-option-description) (generic function)
string
:example
cli-option-example (generic function)
(setf cli-option-example) (generic function)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal special variables | ||
• Internal macros | ||
• Internal functions |
Next: Internal macros, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
Long option prefix.
cli-parser.lisp (file)
String used to display for example.
cli-parser.lisp (file)
String used to separate option values.
cli-parser.lisp (file)
Short option prefix.
cli-parser.lisp (file)
Next: Internal functions, Previous: Internal special variables, Up: Internal definitions [Contents][Index]
Pretty print the SLOTS of a CLOS class INSTANCE, to
STREAM.
INTER-SLOT-NEWLINE-STYLE and INTRA-SLOT-NEWLINE-STYLE may be any
value appropriate appropriate as the first argument to
PPRINT-NEWLINE. A newline of INTER-SLOT-NEWLINE-STYLE will be
printed between each of the slot-name/slot-value pairs of each
slot in SLOTS. A newline of INTRA-SLOT-NEWLINE-STYLE will be
printed between the slot-name and the slot-value of each slot
in SLOTS.
UNBOUND-MSG should be a string which will be printed as the
slot-value for any slot in INSTANCE which is unbound.
SLOT-VALUE-CALLBACK should be a function of two arguments, the
slot-name and the slot-value, which should return an object
which will be printed in place of the slot-value for
slot-name.
Example:
> (defclass foo () (a b))
#<STANDARD-CLASS FOO>
> (defmethod cl:print-object ((f foo) stream)
(pprint-clos-class f (a b) stream))
#<STANDARD-METHOD PRINT-OBJECT (FOO T) {4865E569}>
> (make-instance ’foo)
#<FOO :A <unbound> :B <unbound>>
> (setf (slot-value * ’a) ’bar)
BAR
> **
#<FOO :A BAR :B <unbound>>
cli-parser.lisp (file)
Previous: Internal macros, Up: Internal definitions [Contents][Index]
Converts an abbreviated option (i.e. "o") to its corresponding full option name. Returns the argument if no conversion is performed.
cli-parser.lisp (file)
Test whether opt is a short option of the form "-o[=val]"
cli-parser.lisp (file)
Helper for cli-parse.
cli-parser.lisp (file)
cli-parser.lisp (file)
Will convert a list of the form ("–option-name=val1[,]" "val2[,]" " ... "valn" ...) to a list of the form ("–option-name=val1 val2 val3" ...).
cli-parser.lisp (file)
Helper for coalesce-options.
cli-parser.lisp (file)
Returns the index of the end of the option-name. For example, end-opt-name would return 6 for the option "–opt1=val1"
cli-parser.lisp (file)
cli-parser.lisp (file)
Test whether opt is a long option of the form "–opt[=val]"
cli-parser.lisp (file)
Extract the name of an option: for example "opt1" is the name from "–opt1=val1". Will return the argument if it is neither.
cli-parser.lisp (file)
Evaluates to true if opt is an abbreviated or a full option.
cli-parser.lisp (file)
Extract the values of an option: for example "val1" is the value from "–opt1=val1". If no values are specified, this function returns nil.
cli-parser.lisp (file)
Returns the character in the string which both matches any of the val-separators and minimizes the distance between it and the index 0 of the string. If there is no match, returns the length of the string.
cli-parser.lisp (file)
Returns the first token by parsing str. Analagous to car, but for the string tokenizer, instead of for lists.
cli-parser.lisp (file)
Returns the rest of the string, not including the first
token. Analagous to cdr, but for the string tokenizer, instead of for
lists.
cli-parser.lisp (file)
Breaks up a given string into string components by splitting the string every time an element of val-separator is encountered. Returns a list of strings, which are all the tokens. If include-separators is non-nil, the separators themselves will be included in the parse.
cli-parser.lisp (file)
Helper for string-tokenize.
cli-parser.lisp (file)
Convert an option name to the full one, if necessary. Change "o" to "outfile", for example.
cli-parser.lisp (file)
Converts any abbreviated option list of command-line options to the full option name.
cli-parser.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | C F L |
---|
Jump to: | C F L |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | (
A C E F G M O P S T |
---|
Jump to: | (
A C E F G M O P S T |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
A D E L S |
---|
Jump to: | *
A D E L S |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | C P S |
---|
Jump to: | C P S |
---|