Usage
flag c
flag(c, s)
flag? c
flag?(c, s)
Signatures
flag: Character List String
flag: (Character,String) List String
flag?: Character Boolean
flag?: (Character, String) Boolean
Parameter | Type | Description |
---|---|---|
c | Character | flag code to look for |
s | String | special flag codes (optional) |
Returns
flag(c) returns all the values of the flag c each time it is present in the command line, an empty list otherwise.
flag?(c) returns true if the flag c is present in the command line, false otherwise.
In both functions, the optional argument s contains a list of flag codes which cause the rest of the argument to be skipped.
Example
If the command line to the program was myprog -lsalli -l gmp -v, then flag?(char "a") and flag?(char "v") both return true, while flag?(char "b") and flag?(char "a", "l") both return false. In addition, flag(char "l") returns the list [``salli'', ``gmp''].