Purpose |
Reads DP4-style command tails with arguments | ||
Old name |
#define _tail_opt(option,get_value) | ||
Syntax |
char* tail_get_option(option, flags) | ||
Parameters |
char* option |
Zero-terminated name to extract from command line | |
|
int flags |
Indicate how to treat the command tail if found | |
Description |
The tail_get_option() function is used to read the command line passed to the program. It recognises DP4 command tails which begin with the minus (-) character. When the command tail has to pass an argument, specify a non-zero flag, for example: dbname = tail_get_option("DB", 2); This returns a pointer to the argument following -DB, in this case, the database name. Because flags is even, the argument is not converted to upper case. If flags is odd, the returned argument is converted to upper case. The predefined flags TAIL_UCASE and TAIL_NOUCASE can be used as well. The parameter option is not case sensitive, and must not contain the negative sign. (int) tail_get_option(option,0) is equivalent to: tail_found(option). Whatever the flags, if the command tail is present, it is removed from the command line, so subsequent calls to the function tail_get_option() with the same parameters will fail, unless multiple copies have been passed. | ||
Return values |
Returns non-zero if command tail found | ||
Example |
|