![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
1.81.1 Getopt class: instance creation (class)
If an error is found, nil is returned. For more information on the syntax of pattern, see #parse:with:do:ifError:.
If an error is found, the parsing is interrupted, errorBlock is evaluated, and the returned value is answered.
Every whitespace-separated part (`word') of pattern specifies a command-line option. If a word ends with a colon, the option will have a mandatory argument. If a word ends with two colons, the option will have an optional argument. Before the colons, multiple option names (either short names like `-l' or long names like `--long') can be specified. Before passing the option to actionBlock, the name will be canonicalized to the last one.
Prefixes of long options are accepted as long as they're unique, and they are canonicalized to the full name before passing it to actionBlock. Additionally, the full name of an option is accepted even if it is the prefix of a longer option.
Mandatory arguments can appear in the next argument, or in the same argument (separated by an = for arguments to long options). Optional arguments must appear in the same argument.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |