This is the com.google.flag Reference Manual, version 1.7, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 06:38:17 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
com.google.flag
Unix command line flag parsing.
Robert Brown <robert.brown@gmail.com>
New BSD license. See the copyright messages in individual files.
An implementation of Google’s gflags command line flag parsing library.
1.7
com.google.base
(system).
package.lisp
(file).
flag.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
com.google.flag/com.google.flag.asd
com.google.flag
(system).
com.google.flag/flag.lisp
package.lisp
(file).
com.google.flag
(system).
command-line
(function).
define-flag
(macro).
parse-command-line
(function).
*registered-flags*
(special variable).
boolean-flag-p
(function).
find-flag
(function).
flag
(class).
flag-parser
(function).
flag-variable
(reader method).
help
(reader method).
parse-boolean
(function).
parse-double-float
(function).
parse-float
(function).
parse-int
(function).
parse-keyword
(function).
parse-single-float
(function).
parse-string
(function).
parse-symbol
(function).
parser
(reader method).
register-flag
(function).
type-specifier
(reader method).
valid-float-characters-p
(function).
validate-flag
(function).
Packages are listed by definition order.
com.google.flag
Command line flag parsing.
com.google.base
.
common-lisp
.
command-line
(function).
define-flag
(macro).
parse-command-line
(function).
*registered-flags*
(special variable).
boolean-flag-p
(function).
find-flag
(function).
flag
(class).
flag-parser
(function).
flag-variable
(generic reader).
help
(generic reader).
parse-boolean
(function).
parse-double-float
(function).
parse-float
(function).
parse-int
(function).
parse-keyword
(function).
parse-single-float
(function).
parse-string
(function).
parse-symbol
(function).
parser
(generic reader).
register-flag
(function).
type-specifier
(generic reader).
valid-float-characters-p
(function).
validate-flag
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Defines a global FLAG-VARIABLE of type TYPE, holding value DEFAULT-VALUE,
that can be set via the Unix command line to "value" with argument
"–SELECTOR=value" or arguments "–SELECTOR value". As a special case,
flags of type "boolean" can additionally be set to true with "–SELECTOR"
and to false with "–noSELECTOR".
Optionally, associates a HELP string with the flag and a DOCUMENTATION string
with FLAG-VARIABLE.
Values for flags defined to be of boolean, string, keyword, integer, or
floating point type are parsed by built-in parsers. For flags of other types
supply PARSER, a function designator for a function that converts a string into
a value of type TYPE. The parser must return two values, the parsed flag value
and a boolean indicating whether the parse was successful.
Examples:
(define-flag *debug-mode*
:default-value nil
:selector "debug"
:type boolean
:help "Turn on debugging mode?"
:documentation "Is debugging mode turned on?")
(define-flag *ip-address*
:default-value (make-instance ’ip-address ...)
:selector "ip_address"
:type (satisfies ip-address-p)
:parser ip-address-parser
:help "An internet protocol address.")
Returns the Unix command line as a list of strings.
Parses ARGUMENTS, a list of command line argument strings. If a registered flag is found in ARGUMENTS, sets the flag’s value. Returns a copy of ARGUMENTS, but with all recognized flag arguments removed.
Association list mapping flag selector strings to FLAG instances.
Returns true if FLAG is a boolean flag; otherwise, returns false.
Searches for the registered flag corresponding to the SELECTOR string.
Maps a Lisp TYPE-SPECIFIER form, into a designator for a function that can parse the string representation of a TYPE-SPECIFIER value. Returns NIL when there is no predefined parser for TYPE-SPECIFIER.
Parses a STRING representing a boolean value. Returns two values, the boolean and a second boolean indicating whether the parse was successful.
Parses STRING, which represents a double precision floating point value. Returns two values, the double-float number and a boolean indicating whether the parse was successful.
Parses STRING, which represents a floating point value of EXPECTED-TYPE. Returns two values, the floating point number and a boolean indicating whether the parse was successful.
Parses STRING, a decimal or hexadecimal representation of an integer. Returns two values, the integer and a boolean indicating whether the parse was successful. STRING is parsed as hexadecimal if it starts with "0x".
Returns a symbol in the keyword package with the same name as STRING and T to indicate that parsing STRING was successful.
Parses STRING, which represents a single precision floating point value. Returns two values, the single-float number and a boolean indicating whether the parse was successful.
Returns two values, STRING and T, to indicate that the parse was (trivially) successful.
If STRING, converted to upper case, represents a package-qualified symbol, returns two values, the symbol and T. Otherwise, returns NIL and NIL.
Stores FLAG in a database of registered flags, indexing it by SELECTOR.
Returns true if every character of STRING is one that may be produced when printing a FLOAT-TYPE floating point number. Otherwise, returns false.
Validates whether a FLAG associated with SELECTOR can be registered without causing any flag parsing problems.
A global flag that can be initialized by parsing a command line argument.
Variable holding this flag’s value.
symbol
:flag-variable
This slot is read-only.
Help message describing this flag.
string
:help
help
.
This slot is read-only.
Function designator that names a parser function for the flag. The flag parser takes a string as argument and must return two values, the parsed flag value and a boolean indicating whether the parse was successful.
symbol
:parser
This slot is read-only.
Type of the flag’s value.
(or symbol cons)
:type-specifier
This slot is read-only.
Jump to: | B C D F G H M P R T V |
---|
Jump to: | B C D F G H M P R T V |
---|
Jump to: | *
F H P S T |
---|
Jump to: | *
F H P S T |
---|
Jump to: | C F P S |
---|
Jump to: | C F P S |
---|