ZEDA  1.6.18
Data Fields
zOption Struct Reference

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
 

Detailed Description

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.

Field Documentation

◆ key

const char* zOption::key

option switch

◆ longkey

const char* zOption::longkey

long version option switch

◆ arg_guide

const char* zOption::arg_guide

a guide for option displayed with usage

◆ desc

const char* zOption::desc

description for displaying a usage

◆ arg

char* zOption::arg

an associated argument

◆ flag

bool zOption::flag

check if the option is validated


The documentation for this struct was generated from the following file: