 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
12 #define MAX_TAG_LEN 20
55 for ( i=1; i<argc; i++ ) {
56 if ( strncmp(argv[i],
"-verbose", strlen(argv[i])) == 0 && i<argc-1 ) {
57 if ( argv[i+1][0] !=
'-' )
60 if ( strncmp(argv[i],
"-help", 5) == 0 ) {
67 cout <<
"DEBUG get_option_list:";
68 for ( i=0; i<argc; i++ ) cout <<
" " << argv[i];
73 for ( i=1; i<argc && v; i+=v ) {
75 if ( argv[i][0] ==
'-' ) {
77 if ( !option ) option = curropt = nuopt;
79 curropt->
next = nuopt;
80 curropt = curropt->
next;
86 if ( v == 1 ) cout <<
"DEBUG get_option_list: tag=" << curropt->
tag << endl;
87 else cout <<
"DEBUG get_option_list: tag=" << curropt->
tag <<
" value=" << curropt->
value << endl;
93 cout <<
"DEBUG get_option_list: optind=" << optind;
94 if ( optind < argc ) cout <<
" arg=" << argv[optind] << endl;
99 cerr <<
"Option errors: " << option->
errors() << endl;
115 for ( curropt = option; curropt; ) {
116 curropt2 = curropt->
next;
179 double mass = optarg.
real();
A class for a command line input option.
int bexit(int value)
Exit function for cleanup and debugging.
Boption * get_option_list(const char *use[], int argc, char *argv[], int &optind)
Parses command line arguments based on a template.
Header file for option handlers.
int option_kill(Boption *option)
Deallocates a linked list of option structures.
int get_option_verbose(char *optarg)
Sets the verbose option.
Header file for general utilities.
double get_option_mass(Bstring &optarg)
Returns the adjusted mass based on the added character.
void usage(const char **use, int all)
Prints usage information.
bool contains(const Bstring &s)
int cmd_line(int argc, char **argv)
Reconstructs the command line as a global string.