GetOpt | ||||||||||
Type | function | |||||||||
Dictionary | library.getopt | |||||||||
Library | Command-line Option Parser | |||||||||
Syntax |
| |||||||||
Associations | com.livecode.library.getopt | |||||||||
Summary | Parse options from command line arguments Associated:GetOptLibrary | |||||||||
Parameters |
| |||||||||
Example |
| |||||||||
Values |
| |||||||||
Description | Parse UNIX-like command line arguments, extracting options and their arguments. The GetOpt function parses the command-line arguments. The optional
parameter argumentArray is a numerically-keyed array containing the
arguments to be parsed; if it is omitted, it is set to
The grammar describes the possible options that GetOpt should
understand. It is a string containing a series of option
specifications, separated by spaces. Each option specification is
a series of option names which should be treated as synonyms of each
other, separated by commas. Single-character synonyms are treated
as short ( For example, Each option specification can end with a If a non-option argument is found in argumentArray, GetOpt stops
parsing options and all subsequent arguments are returned as they are.
Short options can be run together. For example, if grammar is
If an option is specified more than once, only the last occurrence is reflected in the return value of GetOpt The return value of GetOpt is an array with three keys:
Argument processing errors occur if:
|