ZEDA
1.6.18
|
command line option information. More...
#include <zeda_option.h>
Data Fields | |
const char * | key |
const char * | longkey |
const char * | arg_guide |
const char * | desc |
char * | arg |
bool | flag |
command line option information.
zOption class associates command line arguments with specified options. It is also utilized for displaying a command usage.
zOption class instance has the following members. key: a short-version key string lasting to '-'. longkey: a long-version key string lasting to '–'. Each option has to have at least either key or longkey. arg_guide: a guide of the argument following the corresponding option to be displayed in the usage. desc: description about the function of the option. arg: a pointer to be associated to the corresponding argument. It should be initialized for the null pointer. flag: the flag to check if the option is validated. It should be initialized for the false value.
A typical notation is as follows:
zOption option[] = { { "x", "xarg", "<x val>", "x value", NULL, false }, ... { NULL, NULL, NULL, NULL, false }, };
The last instance filled with the null pointers is the terminator of the command line option list, needed to seek the end of options.
const char* zOption::key |
option switch
const char* zOption::longkey |
long version option switch
const char* zOption::arg_guide |
a guide for option displayed with usage
const char* zOption::desc |
description for displaying a usage
char* zOption::arg |
an associated argument
bool zOption::flag |
check if the option is validated