#include <Getopt.h>
Definition at line 50 of file Getopt.h.
Static Public Member Functions | |
static void | addopt (Opt *opt) |
Register a new option binding. | |
static int | getopt (const char *progname, int argc, char *const argv[], const char *extra_usage="") |
Parse argv, processing all registered getopt. | |
static void | usage (const char *progname, const char *extra_usage="") |
Prints a nicely formatted usage string to stderr. | |
Protected Types | |
typedef std::vector< Opt * > | OptList |
Static Protected Attributes | |
static Opt * | opts_ [] |
static OptList | allopts_ |
typedef std::vector<Opt*> oasys::Getopt::OptList [protected] |
void oasys::Getopt::addopt | ( | Opt * | opt | ) | [static] |
Register a new option binding.
Definition at line 57 of file Getopt.cc.
References allopts_, opts_, and oasys::Opt::shortopt_.
Referenced by dtntunnel::DTNTunnel::get_options(), dtn::DTND::get_options(), and main().
int oasys::Getopt::getopt | ( | const char * | progname, | |
int | argc, | |||
char *const | argv[], | |||
const char * | extra_usage = "" | |||
) | [static] |
Parse argv, processing all registered getopt.
Returns the index of the first non-option argument in argv
progname | the name of the executable | |
argc | count of command line args | |
argv | command line arg values | |
extra_opts | additional usage string |
Definition at line 73 of file Getopt.cc.
References allopts_, oasys::Opt::needval_, and oasys::Opt::shortopt_.
Referenced by dtntunnel::DTNTunnel::get_options(), dtn::DTND::get_options(), and main().
void oasys::Getopt::usage | ( | const char * | progname, | |
const char * | extra_usage = "" | |||
) | [static] |
Prints a nicely formatted usage string to stderr.
progname | the name of the executable | |
extra_opts | additional usage string |
Definition at line 178 of file Getopt.cc.
References allopts_.
Referenced by dtntunnel::DTNTunnel::get_options(), dtn::DTND::get_options(), and main().
Opt * oasys::Getopt::opts_ [static, protected] |
Getopt::OptList oasys::Getopt::allopts_ [static, protected] |