#include <schroot-options-base.h>
Inheritance diagram for schroot::options_base:
Public Types | |
enum | action_type { ACTION_SESSION_AUTO, ACTION_SESSION_BEGIN, ACTION_SESSION_RECOVER, ACTION_SESSION_RUN, ACTION_SESSION_END, ACTION_HELP, ACTION_VERSION, ACTION_LIST, ACTION_INFO, ACTION_LOCATION, ACTION_CONFIG } |
The action to perform. More... | |
typedef std::tr1::shared_ptr< options_base > | ptr |
A shared_ptr to an options_base object. | |
Public Member Functions | |
options_base () | |
The constructor. | |
virtual | ~options_base () |
The destructor. | |
Public Attributes | |
action_type | action |
The action to perform. | |
sbuild::string_list | chroots |
Chroots to use. | |
std::string | chroot_path |
Chroot to print path. | |
sbuild::string_list | command |
Command to run. | |
std::string | directory |
Directory to use. | |
std::string | user |
User to run as. | |
bool | preserve |
Preserve environment. | |
bool | all |
Use all chroots and sessions. | |
bool | all_chroots |
Use all chroots. | |
bool | all_sessions |
Use all sessions. | |
bool | load_chroots |
Load chroots. | |
bool | load_sessions |
Load sessions. | |
bool | session_force |
Force session operations. | |
Protected Member Functions | |
void | set_action (action_type action) |
Set action. | |
bool | all_used () const |
Check if any of the --all options have been used. | |
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 | chroot |
Chroot options group. | |
boost::program_options::options_description | chrootenv |
Chroot environment options group. | |
boost::program_options::options_description | session |
Session options group. |
This is specialised by the frontends to suit their particular command-line options and behaviour. This class contains functionality and options common to all schroot programs (schroot, dchroot, dchroot-dsa).
Definition at line 50 of file schroot-options-base.h.
typedef std::tr1::shared_ptr<options_base> schroot::options_base::ptr |
A shared_ptr to an options_base object.
Reimplemented from schroot_base::options.
Definition at line 70 of file schroot-options-base.h.
The action to perform.
Definition at line 54 of file schroot-options-base.h.
options_base::options_base | ( | ) |
options_base::~options_base | ( | ) | [virtual] |
void options_base::set_action | ( | action_type | action | ) | [protected] |
Set action.
This detects if an action has already been set (only one action may be specified at once).
action | the action to set. |
Definition at line 223 of file schroot-options-base.cc.
References _, and ACTION_SESSION_AUTO.
Referenced by schroot::options::check_options(), check_options(), dchroot::options::check_options(), and dchroot_dsa::options::check_options().
Here is the caller graph for this function:
bool schroot::options_base::all_used | ( | ) | const [inline, protected] |
Check if any of the --all options have been used.
Definition at line 122 of file schroot-options-base.h.
Referenced by check_actions(), dchroot::options::check_options(), and dchroot_dsa::options::check_options().
Here is the caller graph for this function:
void options_base::add_options | ( | ) | [protected, virtual] |
Add options to option groups.
Reimplemented from schroot_base::options.
Reimplemented in schroot::options, dchroot::options, and dchroot_dsa::options.
Definition at line 57 of file schroot-options-base.cc.
References _, schroot_base::options::add_options(), chroot, chroots, command, schroot_base::options::general, schroot_base::options::hidden, and schroot_base::options::positional.
Referenced by schroot::options::add_options(), dchroot::options::add_options(), and dchroot_dsa::options::add_options().
Here is the call graph for this function:
Here is the caller graph for this function:
void options_base::add_option_groups | ( | ) | [protected, virtual] |
Add option groups to container groups.
Reimplemented from schroot_base::options.
Definition at line 81 of file schroot-options-base.cc.
References schroot_base::options::add_option_groups(), chroot, chrootenv, schroot_base::options::global, session, and schroot_base::options::visible.
Here is the call graph for this function:
void options_base::check_options | ( | ) | [protected, virtual] |
Check options after parsing.
Reimplemented from schroot_base::options.
Reimplemented in schroot::options, dchroot::options, and dchroot_dsa::options.
Definition at line 115 of file schroot-options-base.cc.
References ACTION_CONFIG, ACTION_HELP, ACTION_INFO, ACTION_LIST, ACTION_VERSION, schroot_base::options::check_options(), set_action(), and schroot_base::options::vm.
Referenced by schroot::options::check_options(), dchroot::options::check_options(), and dchroot_dsa::options::check_options().
Here is the call graph for this function:
Here is the caller graph for this function:
void options_base::check_actions | ( | ) | [protected, virtual] |
Check actions after parsing.
Reimplemented from schroot_base::options.
Definition at line 132 of file schroot-options-base.cc.
References _, ACTION_CONFIG, ACTION_HELP, ACTION_INFO, ACTION_LIST, ACTION_LOCATION, ACTION_SESSION_AUTO, ACTION_SESSION_BEGIN, ACTION_SESSION_END, ACTION_SESSION_RECOVER, ACTION_SESSION_RUN, ACTION_VERSION, all, all_chroots, all_sessions, all_used(), load_chroots, load_sessions, sbuild::log_info(), and sbuild::log_warning().
Here is the call graph for this function:
The action to perform.
Definition at line 79 of file schroot-options-base.h.
Referenced by dchroot_dsa::options::check_options().
std::string schroot::options_base::chroot_path |
Chroot to print path.
Definition at line 83 of file schroot-options-base.h.
Referenced by dchroot::options::add_options().
Command to run.
Definition at line 85 of file schroot-options-base.h.
Referenced by add_options(), and dchroot_dsa::options::check_options().
std::string schroot::options_base::directory |
Directory to use.
Definition at line 87 of file schroot-options-base.h.
Referenced by schroot::options::add_options(), dchroot::options::add_options(), and dchroot_dsa::options::add_options().
std::string schroot::options_base::user |
Preserve environment.
Definition at line 91 of file schroot-options-base.h.
Referenced by dchroot_dsa::options::check_options().
Use all chroots and sessions.
Definition at line 93 of file schroot-options-base.h.
Referenced by check_actions(), and dchroot::options::check_options().
Use all chroots.
Definition at line 95 of file schroot-options-base.h.
Referenced by check_actions(), schroot::options::check_options(), and dchroot::options::check_options().
Use all sessions.
Definition at line 97 of file schroot-options-base.h.
Referenced by check_actions(), schroot::options::check_options(), and dchroot::options::check_options().
Load sessions.
Definition at line 101 of file schroot-options-base.h.
Referenced by check_actions().
boost::program_options::options_description schroot::options_base::chroot [protected] |
Chroot options group.
Definition at line 140 of file schroot-options-base.h.
Referenced by add_option_groups(), schroot::options::add_options(), add_options(), dchroot::options::add_options(), and dchroot_dsa::options::add_options().
boost::program_options::options_description schroot::options_base::chrootenv [protected] |
Chroot environment options group.
Definition at line 142 of file schroot-options-base.h.
Referenced by add_option_groups(), schroot::options::add_options(), dchroot::options::add_options(), and dchroot_dsa::options::add_options().
boost::program_options::options_description schroot::options_base::session [protected] |
Session options group.
Definition at line 144 of file schroot-options-base.h.
Referenced by add_option_groups(), and schroot::options::add_options().