# mysqlpp::examples::CommandLine Class Reference

Command line parsing mechanism for ../examples/*.cpp. More...

`#include <cmdline.h>`

Inheritance diagram for mysqlpp::examples::CommandLine:

[legend]
Collaboration diagram for mysqlpp::examples::CommandLine:

[legend]
List of all members.

## Public Member Functions

| CommandLine (int argc, char *const argv[], const char *user=0, const char *pass=0, const char *usage_extra=0)
| Constructor.
void | print_usage () const
| Show a message explaining the program's proper usage.
void | print_usage (const char *extra) const
| Show a message explaining the program's proper usage, with custom extra info after standard command line usage bits.
bool | dtest_mode () const
| Return true if we're in "dtest" mode This happens when an example gets the -D flag, always passed by the dtest script to ask the programs it runs to suppress any nondeterministic output.
const char * | pass () const
| Return the DB password (-p argument).
int | run_mode () const
| Return the -m flag value.
const char * | server () const
| Return the DB server name (-s argument).
const char * | user () const
| Return the DB user name (-u argument).

## Detailed Description

Command line parsing mechanism for ../examples/*.cpp.

## Constructor & Destructor Documentation

mysqlpp::examples::CommandLine::CommandLine | ( | int | argc,
|  | char *const | argv[],
|  | const char * | user = `0`,
|  | const char * | pass = `0`,
|  | const char * | usage_extra = `0` |
| ) |  |  |

Constructor.

Public interface

## Member Function Documentation

void mysqlpp::examples::CommandLine::print_usage | ( |  | ) | const`[inline, virtual]`

Show a message explaining the program's proper usage.

Calls print_usage(const char*), passing along the "usage_extra" parameter passed to the ctor

Implements mysqlpp::CommandLineBase.

int mysqlpp::examples::CommandLine::run_mode | ( |  | ) | const`[inline]`

Return the -m flag value.

This flag is currently only used by examples/deadlock, but it's really a nonspecific "mode" value, which could be used by other examples in the future.

The documentation for this class was generated from the following files:

- cmdline.h
- cmdline.cpp