TF++, Miscellaneous classes and modules in C++:

struct to define options ,This struct is used to define a list of options. An example is: More...

#include <commandline.h>

Public Attributes

const char * opt_string
 option name More...
 
Eopt_arg_mode opt_arg_mode
 option argument mode More...
 
const char * arg_default
 option default argument More...
 

Detailed Description

struct to define options ,

This struct is used to define a list of options. An example is:

// define commandline options
using namespace tf::cmdline;
static Declare options[]=
{
// 0: print help
{"help",arg_no,"-"},
// 1: verbose mode
{"v",arg_no,"-"},
// 2: output device
{"d",arg_yes,"x11"},
{NULL}
};

It defines the options -help, -v, and -d, where the latter does take an argument and the first two not. The array options[] is passed to tfxx::cmdline::Commandline. The first entry in each Declare defines the option anme, the second the argument mode and the third the default argument.

See also
tfxx::cmdline::Commandline
Examples:
tests/commandlinetest.cc, and tests/fortraniotest.cc.

Definition at line 136 of file commandline.h.


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