general/arguments.h File Reference

#include <sigc++/signal.h>

Go to the source code of this file.

Defines

#define ARG_PROGRAM   "=program"
 The name of the command-line tool.
#define ARG_USAGE   "=usage"
 The usage string in the help page.
#define ARG_DESCR   "=descr"
 Description in text.
#define ARG_EXAMPLE   "=example"
 Possible example of usage.
#define ARG_BUGS   "=bugs"
 Report bugs to.
#define ARG_VERSION   "=version"
 Version number.
#define ARG_DATE   "=date"
 Build date.
#define ARG_COPYRIGHT   "=copyright"
 Copyright notice.

Functions

void arg_add (std::string arg, std::string param, std::string group, std::string text, sigc::signal< void, std::string > handler)
 Add a new argument definition to parse.
void arg_extra (std::string arg, std::string param)
 Alternative name of the last argument.
void arg_parse (int args, char *argv[])
 Routine that scans the arguments and invokes the various functions on them.


Define Documentation

#define ARG_BUGS   "=bugs"

Report bugs to.

#define ARG_COPYRIGHT   "=copyright"

Copyright notice.

#define ARG_DATE   "=date"

Build date.

#define ARG_DESCR   "=descr"

Description in text.

#define ARG_EXAMPLE   "=example"

Possible example of usage.

#define ARG_PROGRAM   "=program"

The name of the command-line tool.

#define ARG_USAGE   "=usage"

The usage string in the help page.

#define ARG_VERSION   "=version"

Version number.


Function Documentation

void arg_add ( std::string  arg,
std::string  param,
std::string  group,
std::string  text,
sigc::signal< void, std::string >  handler 
)

Add a new argument definition to parse.

Fill the argument data structure

Parameters:
arg  Name of the argument
param  Parameter of argument name, optional when between [], empty is no arg
group  Group of the argument in the help page
text  Text description
handler  Function to call when this argument is found or NULL

void arg_extra ( std::string  arg,
std::string  param 
)

Alternative name of the last argument.

Parameters:
arg  Alternative name of the argument
param  Argument description, optional show between [], empty is no argument

void arg_parse ( int  args,
char *  argv[] 
)

Routine that scans the arguments and invokes the various functions on them.

This routine also handles --help and --version calls and exists then directly

Parameters:
args  Number of command line arguments
argv  Array of the cmmand line argument strings



Generated on Tue Jan 1 17:30:01 2008 for general/arguments.h File Reference by  doxygen   Visit the project page on SourceForge.net Logo