next up previous contents index
Next: CopyableType Up: CommandLine Previous: command   Contents   Index


flag


Usage

flag c
flag(c, s)
flag? c
flag?(c, s)


Signatures

flag: Character $\to$ List String
flag: (Character,String)$\to$List String
flag?: Character $\to$ Boolean
flag?: (Character, String) $\to$ 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''].


next up previous contents index
Next: CopyableType Up: CommandLine Previous: command   Contents   Index
Manuel Bronstein 2004-06-28