schroot_base::options Class Reference

Basic schroot command-line options. More...

#include <schroot-base-options.h>

Inheritance diagram for schroot_base::options:

Inheritance graph
[legend]
Collaboration diagram for schroot_base::options:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::tr1::shared_ptr<
options
ptr
 A shared_ptr to an options object.
typedef option_action::action_type action_type

Public Member Functions

 options ()
 The constructor.
virtual ~options ()
 The destructor.
void parse (int argc, char *argv[])
 Parse the command-line options.
boost::program_options::options_description
const & 
get_visible_options () const
 Get the visible options group.

Public Attributes

option_action action
 Action list.
bool quiet
 Quiet messages.
bool verbose
 Verbose messages.

Static Public Attributes

static const action_type ACTION_HELP
 Display program help.
static const action_type ACTION_VERSION
 Display program version.

Protected Member Functions

virtual void add_options ()
 Add options to option groups.
virtual void add_option_groups ()
 Add option groups to container groups.
virtual void check_options ()
 Check options after parsing.
virtual void check_actions ()
 Check actions after parsing.

Protected Attributes

boost::program_options::options_description actions
 Actions options group.
boost::program_options::options_description general
 General options group.
boost::program_options::options_description hidden
 Hidden options group.
boost::program_options::positional_options_description positional
 Positional options group.
boost::program_options::options_description visible
 Visible options container (used for --help).
boost::program_options::options_description global
 Global options container (used for parsing).
boost::program_options::variables_map vm
 Variables map, filled during parsing.

Private Attributes

std::string debug_level
 Debug level string.

Detailed Description

Basic schroot command-line options.

This is specialised by the frontends to suit their particular command-line options and behaviour. This class implements the functionality common to all options parsing classes.

Definition at line 50 of file schroot-base-options.h.


Member Typedef Documentation

typedef std::tr1::shared_ptr<options> schroot_base::options::ptr

A shared_ptr to an options object.

Reimplemented in schroot::options_base, schroot_listmounts::options, schroot_releaselock::options, and csbuild::options.

Definition at line 54 of file schroot-base-options.h.

typedef option_action::action_type schroot_base::options::action_type

Definition at line 55 of file schroot-base-options.h.


Constructor & Destructor Documentation

options::options (  ) 

The constructor.

Reimplemented in schroot::options, schroot_listmounts::options, schroot_releaselock::options, dchroot::options, dchroot_dsa::options, and csbuild::options.

Definition at line 41 of file schroot-base-options.cc.

Referenced by parse().

Here is the caller graph for this function:

options::~options (  )  [virtual]

The destructor.

Reimplemented in schroot::options, schroot_listmounts::options, schroot_releaselock::options, dchroot::options, dchroot_dsa::options, and csbuild::options.

Definition at line 55 of file schroot-base-options.cc.


Member Function Documentation

void options::parse ( int  argc,
char *  argv[] 
)

Parse the command-line options.

Parameters:
argc the number of arguments
argv argument vector

Definition at line 66 of file schroot-base-options.cc.

References add_option_groups(), add_options(), check_actions(), check_options(), global, options(), positional, schroot_base::run(), and vm.

boost::program_options::options_description const & options::get_visible_options (  )  const

Get the visible options group.

This options group contains all the options visible to the user.

Returns:
the options_description.

Definition at line 60 of file schroot-base-options.cc.

References visible.

void options::add_options (  )  [protected, virtual]

Add options to option groups.

Reimplemented in schroot::options_base, schroot::options, schroot_listmounts::options, schroot_releaselock::options, dchroot::options, dchroot_dsa::options, and csbuild::options.

Definition at line 81 of file schroot-base-options.cc.

References action, ACTION_HELP, ACTION_VERSION, actions, schroot_base::option_action::add(), debug_level, general, and hidden.

Referenced by schroot::options_base::add_options(), schroot_releaselock::options::add_options(), schroot_listmounts::options::add_options(), csbuild::options::add_options(), and parse().

Here is the caller graph for this function:

void options::add_option_groups (  )  [protected, virtual]

Add option groups to container groups.

Reimplemented in schroot::options_base, schroot_listmounts::options, schroot_releaselock::options, and csbuild::options.

Definition at line 104 of file schroot-base-options.cc.

References actions, general, global, hidden, and visible.

Referenced by schroot::options_base::add_option_groups(), schroot_releaselock::options::add_option_groups(), schroot_listmounts::options::add_option_groups(), csbuild::options::add_option_groups(), and parse().

Here is the caller graph for this function:

void options::check_options (  )  [protected, virtual]

Check options after parsing.

Reimplemented in schroot::options_base, schroot::options, schroot_listmounts::options, schroot_releaselock::options, dchroot::options, dchroot_dsa::options, and csbuild::options.

Definition at line 133 of file schroot-base-options.cc.

References ACTION_HELP, ACTION_VERSION, sbuild::DEBUG_CRITICAL, sbuild::DEBUG_INFO, sbuild::debug_level, sbuild::DEBUG_NONE, sbuild::DEBUG_NOTICE, sbuild::DEBUG_WARNING, and vm.

Referenced by schroot::options_base::check_options(), schroot_releaselock::options::check_options(), schroot_listmounts::options::check_options(), csbuild::options::check_options(), and parse().

Here is the caller graph for this function:

void options::check_actions (  )  [protected, virtual]

Check actions after parsing.

Reimplemented in schroot::options_base.

Definition at line 166 of file schroot-base-options.cc.

Referenced by schroot::options_base::check_actions(), and parse().

Here is the caller graph for this function:


Member Data Documentation

const options::action_type options::ACTION_HELP [static]

Display program help.

Definition at line 74 of file schroot-base-options.h.

Referenced by add_options(), schroot::options_base::check_actions(), check_options(), dchroot_dsa::options::check_options(), schroot::main_base::run_impl(), schroot_releaselock::main::run_impl(), schroot_listmounts::main::run_impl(), and csbuild::main::run_impl().

const options::action_type options::ACTION_VERSION [static]

Display program version.

Definition at line 76 of file schroot-base-options.h.

Referenced by add_options(), schroot::options_base::check_actions(), check_options(), dchroot_dsa::options::check_options(), schroot::main_base::run_impl(), schroot_releaselock::main::run_impl(), schroot_listmounts::main::run_impl(), and csbuild::main::run_impl().

option_action schroot_base::options::action

Action list.

Definition at line 79 of file schroot-base-options.h.

Referenced by schroot::options_base::add_options(), schroot_releaselock::options::add_options(), schroot_listmounts::options::add_options(), add_options(), csbuild::options::add_options(), and dchroot_dsa::options::check_options().

bool schroot_base::options::quiet

Quiet messages.

Definition at line 82 of file schroot-base-options.h.

bool schroot_base::options::verbose

Verbose messages.

Definition at line 84 of file schroot-base-options.h.

boost::program_options::options_description schroot_base::options::actions [protected]

Actions options group.

Definition at line 121 of file schroot-base-options.h.

Referenced by add_option_groups(), schroot::options::add_options(), schroot::options_base::add_options(), add_options(), dchroot::options::add_options(), dchroot_dsa::options::add_options(), and csbuild::options::add_options().

boost::program_options::options_description schroot_base::options::general [protected]

General options group.

Definition at line 123 of file schroot-base-options.h.

Referenced by add_option_groups(), add_options(), and csbuild::options::add_options().

boost::program_options::options_description schroot_base::options::hidden [protected]

Hidden options group.

Definition at line 125 of file schroot-base-options.h.

Referenced by add_option_groups(), schroot::options_base::add_options(), and add_options().

boost::program_options::positional_options_description schroot_base::options::positional [protected]

Positional options group.

Definition at line 127 of file schroot-base-options.h.

Referenced by schroot::options_base::add_options(), and parse().

boost::program_options::options_description schroot_base::options::visible [protected]

Visible options container (used for --help).

Definition at line 129 of file schroot-base-options.h.

Referenced by schroot::options_base::add_option_groups(), schroot_releaselock::options::add_option_groups(), schroot_listmounts::options::add_option_groups(), add_option_groups(), csbuild::options::add_option_groups(), and get_visible_options().

boost::program_options::options_description schroot_base::options::global [protected]

Global options container (used for parsing).

Definition at line 131 of file schroot-base-options.h.

Referenced by schroot::options_base::add_option_groups(), schroot_releaselock::options::add_option_groups(), schroot_listmounts::options::add_option_groups(), add_option_groups(), csbuild::options::add_option_groups(), and parse().

boost::program_options::variables_map schroot_base::options::vm [protected]

Variables map, filled during parsing.

Definition at line 133 of file schroot-base-options.h.

Referenced by schroot::options::check_options(), schroot::options_base::check_options(), check_options(), dchroot::options::check_options(), dchroot_dsa::options::check_options(), csbuild::options::check_options(), and parse().

std::string schroot_base::options::debug_level [private]

Debug level string.

Definition at line 137 of file schroot-base-options.h.

Referenced by add_options().


The documentation for this class was generated from the following files:
Generated on Sun Jul 8 21:24:31 2007 for schroot by  doxygen 1.5.2