tail_found()

Purpose

Checks for the presence of an option on the command line

Syntax

boolean tail_found(option)

Parameters

char * option

Zero-terminated name to look for on command line

Description

The tail_found() function returns TRUE if the string pointed to by the parameter option occurs in the argument list (preceded by the hyphen (-) character) and FALSE otherwise. If the command tail exists, it is removed from the command line, so subsequent calls to the function tail_found() with the same parameters will fail, unless multiple copies have been passed.

The parameter option is not case sensitive and must not contain the leading - character. To read command line options with arguments use tail_get_option().

tail_found(option) is equivalent to:
(int) tail_get_option(option,0)

Return values

Returns TRUE if the string is found, and FALSE otherwise

See also

tail_get_option()

Example

The following returns TRUE, on the first call only, if -HELP is supplied to the program on the command line:

tail_found("help")