36
30
<a name="l00011"></a>00011 <span class="comment"> * General Public License for more details.</span>
37
31
<a name="l00012"></a>00012 <span class="comment"> *</span>
38
32
<a name="l00013"></a>00013 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
39
<a name="l00014"></a>00014 <span class="comment"> * along with this program; if not, write to the Free Software</span>
40
<a name="l00015"></a>00015 <span class="comment"> * Foundation, Inc., 59 Temple Place, Suite 330, Boston,</span>
41
<a name="l00016"></a>00016 <span class="comment"> * MA 02111-1307 USA</span>
42
<a name="l00017"></a>00017 <span class="comment"> *</span>
43
<a name="l00018"></a>00018 <span class="comment"> *********************************************************************/</span>
44
<a name="l00019"></a>00019
45
<a name="l00020"></a>00020 <span class="preprocessor">#include <config.h></span>
46
<a name="l00021"></a>00021
47
<a name="l00022"></a>00022 <span class="preprocessor">#include "<a class="code" href="schroot-options_8h.html">schroot-options.h</a>"</span>
48
<a name="l00023"></a>00023
49
<a name="l00024"></a>00024 <span class="preprocessor">#include <cstdlib></span>
50
<a name="l00025"></a>00025 <span class="preprocessor">#include <iostream></span>
51
<a name="l00026"></a>00026
52
<a name="l00027"></a>00027 <span class="preprocessor">#include <boost/format.hpp></span>
53
<a name="l00028"></a>00028 <span class="preprocessor">#include <boost/program_options.hpp></span>
54
<a name="l00029"></a>00029
55
<a name="l00030"></a>00030 <span class="keyword">using</span> std::endl;
56
<a name="l00031"></a>00031 <span class="keyword">using</span> boost::format;
57
<a name="l00032"></a>00032 <span class="keyword">using</span> sbuild::_;
58
<a name="l00033"></a>00033 <span class="keyword">namespace </span>opt = boost::program_options;
59
<a name="l00034"></a>00034 <span class="keyword">using namespace </span>schroot;
60
<a name="l00035"></a>00035
61
<a name="l00036"></a>00036 <span class="keyword">const</span> options_base::action_type options_base::ACTION_SESSION_AUTO (<span class="stringliteral">"session_auto"</span>);
62
<a name="l00037"></a>00037 <span class="keyword">const</span> options_base::action_type options_base::ACTION_SESSION_BEGIN (<span class="stringliteral">"session_begin"</span>);
63
<a name="l00038"></a>00038 <span class="keyword">const</span> options_base::action_type options_base::ACTION_SESSION_RECOVER (<span class="stringliteral">"session_recover"</span>);
64
<a name="l00039"></a>00039 <span class="keyword">const</span> options_base::action_type options_base::ACTION_SESSION_RUN (<span class="stringliteral">"session_run"</span>);
65
<a name="l00040"></a>00040 <span class="keyword">const</span> options_base::action_type options_base::ACTION_SESSION_END (<span class="stringliteral">"session_end"</span>);
66
<a name="l00041"></a>00041 <span class="keyword">const</span> options_base::action_type options_base::ACTION_LIST (<span class="stringliteral">"list"</span>);
67
<a name="l00042"></a>00042 <span class="keyword">const</span> options_base::action_type options_base::ACTION_INFO (<span class="stringliteral">"info"</span>);
68
<a name="l00043"></a>00043 <span class="keyword">const</span> options_base::action_type options_base::ACTION_LOCATION (<span class="stringliteral">"location"</span>);
69
<a name="l00044"></a>00044 <span class="keyword">const</span> options_base::action_type options_base::ACTION_CONFIG (<span class="stringliteral">"config"</span>);
70
<a name="l00045"></a>00045
71
<a name="l00046"></a><a class="code" href="classschroot_1_1options__base.html#9afdb9228e0e46d6a829935bde436210">00046</a> options_base::options_base ():
72
<a name="l00047"></a>00047 schroot_base::<a class="code" href="classschroot_1_1options.html" title="schroot command-line options.">options</a> (),
73
<a name="l00048"></a>00048 chroots(),
74
<a name="l00049"></a>00049 command(),
75
<a name="l00050"></a>00050 user(),
76
<a name="l00051"></a>00051 preserve(false),
77
<a name="l00052"></a>00052 all(false),
78
<a name="l00053"></a>00053 all_chroots(false),
79
<a name="l00054"></a>00054 all_sessions(false),
80
<a name="l00055"></a>00055 session_name(),
81
<a name="l00056"></a>00056 session_force(false),
82
<a name="l00057"></a>00057 chroot(_(<span class="stringliteral">"Chroot selection"</span>)),
83
<a name="l00058"></a>00058 chrootenv(_(<span class="stringliteral">"Chroot environment"</span>)),
84
<a name="l00059"></a>00059 session_actions(_(<span class="stringliteral">"Session actions"</span>)),
85
<a name="l00060"></a>00060 session_options(_(<span class="stringliteral">"Session options"</span>))
86
<a name="l00061"></a>00061 {
87
<a name="l00062"></a>00062 }
88
<a name="l00063"></a>00063
89
<a name="l00064"></a><a class="code" href="classschroot_1_1options__base.html#d9c33fd9cc7896cb3fc0d148a98e5ea6">00064</a> <a class="code" href="classschroot_1_1options__base.html#d9c33fd9cc7896cb3fc0d148a98e5ea6" title="The destructor.">options_base::~options_base</a> ()
90
<a name="l00065"></a>00065 {
91
<a name="l00066"></a>00066 }
92
<a name="l00067"></a>00067
93
<a name="l00068"></a>00068 <span class="keywordtype">void</span>
94
<a name="l00069"></a><a class="code" href="classschroot_1_1options__base.html#82640b1848dbba31d5cf38edb9ac08f1">00069</a> <a class="code" href="classschroot_1_1options__base.html#82640b1848dbba31d5cf38edb9ac08f1" title="Add options to option groups.">options_base::add_options</a> ()
95
<a name="l00070"></a>00070 {
96
<a name="l00071"></a>00071 <span class="comment">// Chain up to add basic options.</span>
97
<a name="l00072"></a>00072 <a class="code" href="classschroot__base_1_1options.html#9552a1fefc227463e48e29f4dae89986" title="Add options to option groups.">schroot_base::options::add_options</a>();
98
<a name="l00073"></a>00073
99
<a name="l00074"></a>00074 <a class="code" href="classschroot__base_1_1options.html#5b359a5e43243a64dff27968219735ad" title="Action list.">action</a>.add(<a class="code" href="classschroot_1_1options__base.html#80919c7370c34ed9eda559a51626e83b" title="Begin, run and end a session.">ACTION_SESSION_AUTO</a>);
100
<a name="l00075"></a>00075 <a class="code" href="classschroot__base_1_1options.html#5b359a5e43243a64dff27968219735ad" title="Action list.">action</a>.set_default(<a class="code" href="classschroot_1_1options__base.html#80919c7370c34ed9eda559a51626e83b" title="Begin, run and end a session.">ACTION_SESSION_AUTO</a>);
101
<a name="l00076"></a>00076 <a class="code" href="classschroot__base_1_1options.html#5b359a5e43243a64dff27968219735ad" title="Action list.">action</a>.add(<a class="code" href="classschroot_1_1options__base.html#4b8e1c028c9bd9907118e4bfa9150dbf" title="Begin a session.">ACTION_SESSION_BEGIN</a>);
102
<a name="l00077"></a>00077 <a class="code" href="classschroot__base_1_1options.html#5b359a5e43243a64dff27968219735ad" title="Action list.">action</a>.add(<a class="code" href="classschroot_1_1options__base.html#665269c2416d294d96e3615a76ed1c99" title="Recover an existing session.">ACTION_SESSION_RECOVER</a>);
103
<a name="l00078"></a>00078 <a class="code" href="classschroot__base_1_1options.html#5b359a5e43243a64dff27968219735ad" title="Action list.">action</a>.add(<a class="code" href="classschroot_1_1options__base.html#dffd2e7707484623b402f9776c2a1283" title="Run an existing session.">ACTION_SESSION_RUN</a>);
104
<a name="l00079"></a>00079 <a class="code" href="classschroot__base_1_1options.html#5b359a5e43243a64dff27968219735ad" title="Action list.">action</a>.add(<a class="code" href="classschroot_1_1options__base.html#22317f5a53213c97de5258678de55c56" title="End an existing session.">ACTION_SESSION_END</a>);
105
<a name="l00080"></a>00080 <a class="code" href="classschroot__base_1_1options.html#5b359a5e43243a64dff27968219735ad" title="Action list.">action</a>.add(<a class="code" href="classschroot_1_1options__base.html#29df6276af14260123fe55549260f4cf" title="Display a list of chroots.">ACTION_LIST</a>);
106
<a name="l00081"></a>00081 <a class="code" href="classschroot__base_1_1options.html#5b359a5e43243a64dff27968219735ad" title="Action list.">action</a>.add(<a class="code" href="classschroot_1_1options__base.html#9889bb8cd49347b723f0b014f91fddb3" title="Display chroot information.">ACTION_INFO</a>);
107
<a name="l00082"></a>00082 <a class="code" href="classschroot__base_1_1options.html#5b359a5e43243a64dff27968219735ad" title="Action list.">action</a>.add(<a class="code" href="classschroot_1_1options__base.html#37d022b4ee34451fe63d61737b0faa0c" title="Display chroot location information.">ACTION_LOCATION</a>);
108
<a name="l00083"></a>00083 <a class="code" href="classschroot__base_1_1options.html#5b359a5e43243a64dff27968219735ad" title="Action list.">action</a>.add(<a class="code" href="classschroot_1_1options__base.html#5a050d85d2e6a7920899b901fc28e509" title="Display chroot configuration.">ACTION_CONFIG</a>);
109
<a name="l00084"></a>00084
110
<a name="l00085"></a>00085 <a class="code" href="classschroot__base_1_1options.html#e0290bf2f45c2b3f0958b0e39fe447be" title="Actions options group.">actions</a>.add_options()
111
<a name="l00086"></a>00086 (<span class="stringliteral">"list,l"</span>,
112
<a name="l00087"></a>00087 _(<span class="stringliteral">"List available chroots"</span>))
113
<a name="l00088"></a>00088 (<span class="stringliteral">"info,i"</span>,
114
<a name="l00089"></a>00089 _(<span class="stringliteral">"Show information about selected chroots"</span>))
115
<a name="l00090"></a>00090 (<span class="stringliteral">"config"</span>,
116
<a name="l00091"></a>00091 _(<span class="stringliteral">"Dump configuration of selected chroots"</span>));
117
<a name="l00092"></a>00092
118
<a name="l00093"></a>00093 <a class="code" href="classschroot_1_1options__base.html#10663845e266a779c53580884ce56d0c" title="Chroot options group.">chroot</a>.add_options()
119
<a name="l00094"></a>00094 (<span class="stringliteral">"chroot,c"</span>, opt::value<sbuild::string_list>(&this-><a class="code" href="classschroot_1_1options__base.html#d1832445dd9f7852ec98d62c02eb6960" title="Chroots to use.">chroots</a>),
120
<a name="l00095"></a>00095 _(<span class="stringliteral">"Use specified chroot"</span>));
121
<a name="l00096"></a>00096
122
<a name="l00097"></a>00097 <a class="code" href="classschroot__base_1_1options.html#bf8377656a1eccca804b9b04f1aeb8a8" title="Hidden options group.">hidden</a>.add_options()
123
<a name="l00098"></a>00098 (<span class="stringliteral">"command"</span>, opt::value<sbuild::string_list>(&this-><a class="code" href="classschroot_1_1options__base.html#33f2c84836db46408b58f48e39adee1c" title="Command to run.">command</a>),
124
<a name="l00099"></a>00099 _(<span class="stringliteral">"Command to run"</span>));
125
<a name="l00100"></a>00100
126
<a name="l00101"></a>00101 <a class="code" href="classschroot__base_1_1options.html#d1cb836cb6fa62e3a9f55f41120112f0" title="Positional options group.">positional</a>.add(<span class="stringliteral">"command"</span>, -1);
127
<a name="l00102"></a>00102 }
128
<a name="l00103"></a>00103
129
<a name="l00104"></a>00104 <span class="keywordtype">void</span>
130
<a name="l00105"></a><a class="code" href="classschroot_1_1options__base.html#4df9e636eb67550130db7e5ab1604053">00105</a> <a class="code" href="classschroot_1_1options__base.html#4df9e636eb67550130db7e5ab1604053" title="Add option groups to container groups.">options_base::add_option_groups</a> ()
131
<a name="l00106"></a>00106 {
132
<a name="l00107"></a>00107 <span class="comment">// Chain up to add basic option groups.</span>
133
<a name="l00108"></a>00108 <a class="code" href="classschroot__base_1_1options.html#2b423dd600612e9e574674631ecb0fa9" title="Add option groups to container groups.">schroot_base::options::add_option_groups</a>();
134
<a name="l00109"></a>00109
135
<a name="l00110"></a>00110 <span class="preprocessor">#ifndef BOOST_PROGRAM_OPTIONS_DESCRIPTION_OLD</span>
136
<a name="l00111"></a>00111 <span class="preprocessor"></span> <span class="keywordflow">if</span> (!<a class="code" href="classschroot_1_1options__base.html#10663845e266a779c53580884ce56d0c" title="Chroot options group.">chroot</a>.options().empty())
137
<a name="l00112"></a>00112 #<span class="keywordflow">else</span>
138
<a name="l00113"></a>00113 <span class="keywordflow">if</span> (!<a class="code" href="classschroot_1_1options__base.html#10663845e266a779c53580884ce56d0c" title="Chroot options group.">chroot</a>.primary_keys().empty())
139
<a name="l00114"></a>00114 #endif
140
<a name="l00115"></a>00115 {
141
<a name="l00116"></a>00116 <a class="code" href="classschroot__base_1_1options.html#636feb2ab760a968b53755c3bbe86a0c" title="Visible options container (used for --help).">visible</a>.add(<a class="code" href="classschroot_1_1options__base.html#10663845e266a779c53580884ce56d0c" title="Chroot options group.">chroot</a>);
142
<a name="l00117"></a>00117 <a class="code" href="classschroot__base_1_1options.html#294ade49fac4aa6776cf3cb527d7d6b8" title="Global options container (used for parsing).">global</a>.add(chroot);
143
<a name="l00118"></a>00118 }
144
<a name="l00119"></a>00119 <span class="preprocessor">#ifndef BOOST_PROGRAM_OPTIONS_DESCRIPTION_OLD</span>
145
<a name="l00120"></a>00120 <span class="preprocessor"></span> <span class="keywordflow">if</span> (!<a class="code" href="classschroot_1_1options__base.html#3d75a9f784b0ae5e4183cac2aa5c10e8" title="Chroot environment options group.">chrootenv</a>.options().empty())
146
<a name="l00121"></a>00121 #<span class="keywordflow">else</span>
147
<a name="l00122"></a>00122 <span class="keywordflow">if</span> (!<a class="code" href="classschroot_1_1options__base.html#3d75a9f784b0ae5e4183cac2aa5c10e8" title="Chroot environment options group.">chrootenv</a>.primary_keys().empty())
148
<a name="l00123"></a>00123 #endif
149
<a name="l00124"></a>00124 {
150
<a name="l00125"></a>00125 <a class="code" href="classschroot__base_1_1options.html#636feb2ab760a968b53755c3bbe86a0c" title="Visible options container (used for --help).">visible</a>.add(<a class="code" href="classschroot_1_1options__base.html#3d75a9f784b0ae5e4183cac2aa5c10e8" title="Chroot environment options group.">chrootenv</a>);
151
<a name="l00126"></a>00126 <a class="code" href="classschroot__base_1_1options.html#294ade49fac4aa6776cf3cb527d7d6b8" title="Global options container (used for parsing).">global</a>.add(chrootenv);
152
<a name="l00127"></a>00127 }
153
<a name="l00128"></a>00128 <span class="preprocessor">#ifndef BOOST_PROGRAM_OPTIONS_DESCRIPTION_OLD</span>
154
<a name="l00129"></a>00129 <span class="preprocessor"></span> <span class="keywordflow">if</span> (!<a class="code" href="classschroot_1_1options__base.html#f13d1bb6853c45c3860c0e83983d66bf" title="Session actions group.">session_actions</a>.options().empty())
155
<a name="l00130"></a>00130 #<span class="keywordflow">else</span>
156
<a name="l00131"></a>00131 <span class="keywordflow">if</span> (!<a class="code" href="classschroot_1_1options__base.html#f13d1bb6853c45c3860c0e83983d66bf" title="Session actions group.">session_actions</a>.primary_keys().empty())
157
<a name="l00132"></a>00132 #endif
158
<a name="l00133"></a>00133 {
159
<a name="l00134"></a>00134 <a class="code" href="classschroot__base_1_1options.html#636feb2ab760a968b53755c3bbe86a0c" title="Visible options container (used for --help).">visible</a>.add(<a class="code" href="classschroot_1_1options__base.html#f13d1bb6853c45c3860c0e83983d66bf" title="Session actions group.">session_actions</a>);
160
<a name="l00135"></a>00135 <a class="code" href="classschroot__base_1_1options.html#294ade49fac4aa6776cf3cb527d7d6b8" title="Global options container (used for parsing).">global</a>.add(session_actions);
161
<a name="l00136"></a>00136 }
162
<a name="l00137"></a>00137
163
<a name="l00138"></a>00138 <span class="preprocessor">#ifndef BOOST_PROGRAM_OPTIONS_DESCRIPTION_OLD</span>
164
<a name="l00139"></a>00139 <span class="preprocessor"></span> <span class="keywordflow">if</span> (!<a class="code" href="classschroot_1_1options__base.html#9ecda5b919371290e3e958c76a1342ca" title="Session options group.">session_options</a>.options().empty())
165
<a name="l00140"></a>00140 #<span class="keywordflow">else</span>
166
<a name="l00141"></a>00141 <span class="keywordflow">if</span> (!<a class="code" href="classschroot_1_1options__base.html#9ecda5b919371290e3e958c76a1342ca" title="Session options group.">session_options</a>.primary_keys().empty())
167
<a name="l00142"></a>00142 #endif
168
<a name="l00143"></a>00143 {
169
<a name="l00144"></a>00144 <a class="code" href="classschroot__base_1_1options.html#636feb2ab760a968b53755c3bbe86a0c" title="Visible options container (used for --help).">visible</a>.add(<a class="code" href="classschroot_1_1options__base.html#9ecda5b919371290e3e958c76a1342ca" title="Session options group.">session_options</a>);
170
<a name="l00145"></a>00145 <a class="code" href="classschroot__base_1_1options.html#294ade49fac4aa6776cf3cb527d7d6b8" title="Global options container (used for parsing).">global</a>.add(session_options);
171
<a name="l00146"></a>00146 }
172
<a name="l00147"></a>00147 }
173
<a name="l00148"></a>00148
174
<a name="l00149"></a>00149 <span class="keywordtype">void</span>
175
<a name="l00150"></a><a class="code" href="classschroot_1_1options__base.html#23b25578749ce4563737f3f35c7b0354">00150</a> <a class="code" href="classschroot_1_1options__base.html#23b25578749ce4563737f3f35c7b0354" title="Check options after parsing.">options_base::check_options</a> ()
176
<a name="l00151"></a>00151 {
177
<a name="l00152"></a>00152 <span class="comment">// Chain up to check basic options.</span>
178
<a name="l00153"></a>00153 <a class="code" href="classschroot__base_1_1options.html#f4d23a59c343dd177d1041557c8f5f25" title="Check options after parsing.">schroot_base::options::check_options</a>();
179
<a name="l00154"></a>00154
180
<a name="l00155"></a>00155 <span class="keywordflow">if</span> (<a class="code" href="classschroot__base_1_1options.html#7210f17e844a945faaa240e22ed9d27a" title="Variables map, filled during parsing.">vm</a>.count(<span class="stringliteral">"list"</span>))
181
<a name="l00156"></a>00156 this->action = <a class="code" href="classschroot_1_1options__base.html#29df6276af14260123fe55549260f4cf" title="Display a list of chroots.">ACTION_LIST</a>;
182
<a name="l00157"></a>00157 if (<a class="code" href="classschroot__base_1_1options.html#7210f17e844a945faaa240e22ed9d27a" title="Variables map, filled during parsing.">vm</a>.count(<span class="stringliteral">"info"</span>))
183
<a name="l00158"></a>00158 this->action = <a class="code" href="classschroot_1_1options__base.html#9889bb8cd49347b723f0b014f91fddb3" title="Display chroot information.">ACTION_INFO</a>;
184
<a name="l00159"></a>00159 if (<a class="code" href="classschroot__base_1_1options.html#7210f17e844a945faaa240e22ed9d27a" title="Variables map, filled during parsing.">vm</a>.count(<span class="stringliteral">"config"</span>))
185
<a name="l00160"></a>00160 this->action = <a class="code" href="classschroot_1_1options__base.html#5a050d85d2e6a7920899b901fc28e509" title="Display chroot configuration.">ACTION_CONFIG</a>;
186
<a name="l00161"></a>00161 }
187
<a name="l00162"></a>00162
188
<a name="l00163"></a>00163 <span class="keywordtype">void</span>
189
<a name="l00164"></a><a class="code" href="classschroot_1_1options__base.html#3ba2359ad555baf51c4f019a1b47b212">00164</a> <a class="code" href="classschroot_1_1options__base.html#3ba2359ad555baf51c4f019a1b47b212" title="Check actions after parsing.">options_base::check_actions</a> ()
190
<a name="l00165"></a>00165 {
191
<a name="l00166"></a>00166 <span class="comment">// Chain up to check basic actions.</span>
192
<a name="l00167"></a>00167 <a class="code" href="classschroot__base_1_1options.html#24c0c4b9f1758a932ad0cc9e2b24655e" title="Check actions after parsing.">schroot_base::options::check_actions</a>();
193
<a name="l00168"></a>00168
194
<a name="l00169"></a>00169 <span class="keywordflow">if</span> (this->quiet && this->verbose)
195
<a name="l00170"></a>00170 {
196
<a name="l00171"></a>00171 <a class="codeRef" doxygen="sbuild.tag:/tmp/sr/schroot-1.1.5/doc/sbuild/html/" href="/tmp/sr/schroot-1.1.5/doc/sbuild/html/namespacesbuild.html#133a221b9d5fbd4756937f2ec0a02958">sbuild::log_warning</a>()
197
<a name="l00172"></a>00172 << _(<span class="stringliteral">"--quiet and --verbose may not be used at the same time"</span>)
198
<a name="l00173"></a>00173 << endl;
199
<a name="l00174"></a>00174 <a class="codeRef" doxygen="sbuild.tag:/tmp/sr/schroot-1.1.5/doc/sbuild/html/" href="/tmp/sr/schroot-1.1.5/doc/sbuild/html/namespacesbuild.html#4b668d467f8c9c6063cd2c9c7aaf3086">sbuild::log_info</a>() << _(<span class="stringliteral">"Using verbose output"</span>) << endl;
200
<a name="l00175"></a>00175 }
201
<a name="l00176"></a>00176
202
<a name="l00177"></a>00177 <span class="keywordflow">if</span> (!this->chroots.empty() && <a class="code" href="classschroot_1_1options__base.html#a4ac6dc3b126748f17e58452c64fa776" title="Check if any of the --all options have been used.">all_used</a>())
203
<a name="l00178"></a>00178 {
204
<a name="l00179"></a>00179 <a class="codeRef" doxygen="sbuild.tag:/tmp/sr/schroot-1.1.5/doc/sbuild/html/" href="/tmp/sr/schroot-1.1.5/doc/sbuild/html/namespacesbuild.html#133a221b9d5fbd4756937f2ec0a02958">sbuild::log_warning</a>()
205
<a name="l00180"></a>00180 << _(<span class="stringliteral">"--chroot and --all may not be used at the same time"</span>)
206
<a name="l00181"></a>00181 << endl;
207
<a name="l00182"></a>00182 <a class="codeRef" doxygen="sbuild.tag:/tmp/sr/schroot-1.1.5/doc/sbuild/html/" href="/tmp/sr/schroot-1.1.5/doc/sbuild/html/namespacesbuild.html#4b668d467f8c9c6063cd2c9c7aaf3086">sbuild::log_info</a>() << _(<span class="stringliteral">"Using --chroots only"</span>) << endl;
208
<a name="l00183"></a>00183 this-><a class="code" href="classschroot_1_1options__base.html#90fd0bc62e0bf5d6d443d9050e3b69a9" title="Use all chroots and sessions.">all</a> = this-><a class="code" href="classschroot_1_1options__base.html#efd0c597bc6296f9f8d6e424f57b82f5" title="Use all chroots.">all_chroots</a> = this-><a class="code" href="classschroot_1_1options__base.html#2252a91f088045f89793cee014c1aebc" title="Use all sessions.">all_sessions</a> = <span class="keyword">false</span>;
209
<a name="l00184"></a>00184 }
210
<a name="l00185"></a>00185
211
<a name="l00186"></a>00186 <span class="comment">/* Determine which chroots to load and use. */</span>
212
<a name="l00187"></a>00187 <span class="keywordflow">if</span> (this->action == <a class="code" href="classschroot_1_1options__base.html#80919c7370c34ed9eda559a51626e83b" title="Begin, run and end a session.">ACTION_SESSION_AUTO</a>)
213
<a name="l00188"></a>00188 {
214
<a name="l00189"></a>00189 <span class="comment">// Only allow normal chroots</span>
215
<a name="l00190"></a>00190 this-><a class="code" href="classschroot_1_1options__base.html#24d45cd12a24dde86419543e43b38544" title="Load chroots.">load_chroots</a> = <span class="keyword">true</span>;
216
<a name="l00191"></a>00191 this-><a class="code" href="classschroot_1_1options__base.html#c3c7ef9ab25b573e8d5d3cfbb92510b6" title="Load sessions.">load_sessions</a> = <span class="keyword">false</span>;
217
<a name="l00192"></a>00192 this-><a class="code" href="classschroot_1_1options__base.html#90fd0bc62e0bf5d6d443d9050e3b69a9" title="Use all chroots and sessions.">all</a> = this-><a class="code" href="classschroot_1_1options__base.html#2252a91f088045f89793cee014c1aebc" title="Use all sessions.">all_sessions</a> = <span class="keyword">false</span>;
218
<a name="l00193"></a>00193
219
<a name="l00194"></a>00194 <span class="comment">// If no chroot was specified, fall back to the "default" chroot.</span>
220
<a name="l00195"></a>00195 <span class="keywordflow">if</span> (this->chroots.empty() && <a class="code" href="classschroot_1_1options__base.html#a4ac6dc3b126748f17e58452c64fa776" title="Check if any of the --all options have been used.">all_used</a>() == <span class="keyword">false</span>)
221
<a name="l00196"></a>00196 this->chroots.push_back(<span class="stringliteral">"default"</span>);
222
<a name="l00197"></a>00197 }
223
<a name="l00198"></a>00198 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (this->action == <a class="code" href="classschroot_1_1options__base.html#4b8e1c028c9bd9907118e4bfa9150dbf" title="Begin a session.">ACTION_SESSION_BEGIN</a>)
224
<a name="l00199"></a>00199 {
225
<a name="l00200"></a>00200 <span class="comment">// Only allow one session chroot</span>
226
<a name="l00201"></a>00201 this-><a class="code" href="classschroot_1_1options__base.html#24d45cd12a24dde86419543e43b38544" title="Load chroots.">load_chroots</a> = <span class="keyword">true</span>;
227
<a name="l00202"></a>00202 this-><a class="code" href="classschroot_1_1options__base.html#c3c7ef9ab25b573e8d5d3cfbb92510b6" title="Load sessions.">load_sessions</a> = <span class="keyword">false</span>;
228
<a name="l00203"></a>00203 <span class="keywordflow">if</span> (this->chroots.size() != 1 || <a class="code" href="classschroot_1_1options__base.html#a4ac6dc3b126748f17e58452c64fa776" title="Check if any of the --all options have been used.">all_used</a>())
229
<a name="l00204"></a>00204 <span class="keywordflow">throw</span> opt::validation_error(_(<span class="stringliteral">"Exactly one chroot must be specified when beginning a session"</span>));
230
<a name="l00205"></a>00205
231
<a name="l00206"></a>00206 this-><a class="code" href="classschroot_1_1options__base.html#90fd0bc62e0bf5d6d443d9050e3b69a9" title="Use all chroots and sessions.">all</a> = this-><a class="code" href="classschroot_1_1options__base.html#efd0c597bc6296f9f8d6e424f57b82f5" title="Use all chroots.">all_chroots</a> = this-><a class="code" href="classschroot_1_1options__base.html#2252a91f088045f89793cee014c1aebc" title="Use all sessions.">all_sessions</a> = <span class="keyword">false</span>;
232
<a name="l00207"></a>00207 }
233
<a name="l00208"></a>00208 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (this->action == <a class="code" href="classschroot_1_1options__base.html#665269c2416d294d96e3615a76ed1c99" title="Recover an existing session.">ACTION_SESSION_RECOVER</a> ||
234
<a name="l00209"></a>00209 this->action == <a class="code" href="classschroot_1_1options__base.html#dffd2e7707484623b402f9776c2a1283" title="Run an existing session.">ACTION_SESSION_RUN</a> ||
235
<a name="l00210"></a>00210 this->action == <a class="code" href="classschroot_1_1options__base.html#22317f5a53213c97de5258678de55c56" title="End an existing session.">ACTION_SESSION_END</a>)
236
<a name="l00211"></a>00211 {
237
<a name="l00212"></a>00212 <span class="comment">// Session operations work on all chroots.</span>
238
<a name="l00213"></a>00213 this-><a class="code" href="classschroot_1_1options__base.html#24d45cd12a24dde86419543e43b38544" title="Load chroots.">load_chroots</a> = this-><a class="code" href="classschroot_1_1options__base.html#c3c7ef9ab25b573e8d5d3cfbb92510b6" title="Load sessions.">load_sessions</a> = <span class="keyword">true</span>;
239
<a name="l00214"></a>00214 }
240
<a name="l00215"></a>00215 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (this->action == <a class="code" href="classschroot__base_1_1options.html#4c1f304c9f30b5965dcb7bbf51554124" title="Display program help.">ACTION_HELP</a> ||
241
<a name="l00216"></a>00216 this->action == <a class="code" href="classschroot__base_1_1options.html#1064a6609731fbc80abb0c849ff3a3f8" title="Display program version.">ACTION_VERSION</a>)
242
<a name="l00217"></a>00217 {
243
<a name="l00218"></a>00218 <span class="comment">// Chroots don't make sense here.</span>
244
<a name="l00219"></a>00219 this-><a class="code" href="classschroot_1_1options__base.html#24d45cd12a24dde86419543e43b38544" title="Load chroots.">load_chroots</a> = this-><a class="code" href="classschroot_1_1options__base.html#c3c7ef9ab25b573e8d5d3cfbb92510b6" title="Load sessions.">load_sessions</a> = <span class="keyword">false</span>;
245
<a name="l00220"></a>00220 this-><a class="code" href="classschroot_1_1options__base.html#90fd0bc62e0bf5d6d443d9050e3b69a9" title="Use all chroots and sessions.">all</a> = this-><a class="code" href="classschroot_1_1options__base.html#efd0c597bc6296f9f8d6e424f57b82f5" title="Use all chroots.">all_chroots</a> = this-><a class="code" href="classschroot_1_1options__base.html#2252a91f088045f89793cee014c1aebc" title="Use all sessions.">all_sessions</a> = <span class="keyword">false</span>;
246
<a name="l00221"></a>00221 }
247
<a name="l00222"></a>00222 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (this->action == <a class="code" href="classschroot_1_1options__base.html#29df6276af14260123fe55549260f4cf" title="Display a list of chroots.">ACTION_LIST</a>)
248
<a name="l00223"></a>00223 {
249
<a name="l00224"></a>00224 <span class="comment">// If not specified otherwise, load normal chroots, but allow</span>
250
<a name="l00225"></a>00225 <span class="comment">// --all options.</span>
251
<a name="l00226"></a>00226 <span class="keywordflow">if</span> (!<a class="code" href="classschroot_1_1options__base.html#a4ac6dc3b126748f17e58452c64fa776" title="Check if any of the --all options have been used.">all_used</a>())
252
<a name="l00227"></a>00227 this-><a class="code" href="classschroot_1_1options__base.html#24d45cd12a24dde86419543e43b38544" title="Load chroots.">load_chroots</a> = <span class="keyword">true</span>;
253
<a name="l00228"></a>00228 <span class="keywordflow">if</span> (this->all_chroots)
254
<a name="l00229"></a>00229 this-><a class="code" href="classschroot_1_1options__base.html#24d45cd12a24dde86419543e43b38544" title="Load chroots.">load_chroots</a> = <span class="keyword">true</span>;
255
<a name="l00230"></a>00230 <span class="keywordflow">if</span> (this->all_sessions)
256
<a name="l00231"></a>00231 this-><a class="code" href="classschroot_1_1options__base.html#c3c7ef9ab25b573e8d5d3cfbb92510b6" title="Load sessions.">load_sessions</a> = <span class="keyword">true</span>;
257
<a name="l00232"></a>00232 <span class="keywordflow">if</span> (!this->chroots.empty())
258
<a name="l00233"></a>00233 <span class="keywordflow">throw</span> opt::validation_error(_(<span class="stringliteral">"--chroot may not be used with --list"</span>));
259
<a name="l00234"></a>00234 }
260
<a name="l00235"></a>00235 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (this->action == <a class="code" href="classschroot_1_1options__base.html#9889bb8cd49347b723f0b014f91fddb3" title="Display chroot information.">ACTION_INFO</a> ||
261
<a name="l00236"></a>00236 this->action == <a class="code" href="classschroot_1_1options__base.html#37d022b4ee34451fe63d61737b0faa0c" title="Display chroot location information.">ACTION_LOCATION</a> ||
262
<a name="l00237"></a>00237 this->action == <a class="code" href="classschroot_1_1options__base.html#5a050d85d2e6a7920899b901fc28e509" title="Display chroot configuration.">ACTION_CONFIG</a>)
263
<a name="l00238"></a>00238 {
264
<a name="l00239"></a>00239 <span class="comment">// If not specified otherwise, load normal chroots, but allow</span>
265
<a name="l00240"></a>00240 <span class="comment">// --all options.</span>
266
<a name="l00241"></a>00241 <span class="keywordflow">if</span> (!this->chroots.empty()) <span class="comment">// chroot specified</span>
267
<a name="l00242"></a>00242 this->load_chroots = this->load_sessions = <span class="keyword">true</span>;
268
<a name="l00243"></a>00243 <span class="keywordflow">else</span> if (!<a class="code" href="classschroot_1_1options__base.html#a4ac6dc3b126748f17e58452c64fa776" title="Check if any of the --all options have been used.">all_used</a>()) <span class="comment">// no chroots specified</span>
269
<a name="l00244"></a>00244 {
270
<a name="l00245"></a>00245 this-><a class="code" href="classschroot_1_1options__base.html#efd0c597bc6296f9f8d6e424f57b82f5" title="Use all chroots.">all_chroots</a> = <span class="keyword">true</span>;
271
<a name="l00246"></a>00246 this-><a class="code" href="classschroot_1_1options__base.html#24d45cd12a24dde86419543e43b38544" title="Load chroots.">load_chroots</a> = <span class="keyword">true</span>;
272
<a name="l00247"></a>00247 }
273
<a name="l00248"></a>00248 <span class="keywordflow">if</span> (this->all_chroots)
274
<a name="l00249"></a>00249 this-><a class="code" href="classschroot_1_1options__base.html#24d45cd12a24dde86419543e43b38544" title="Load chroots.">load_chroots</a> = <span class="keyword">true</span>;
275
<a name="l00250"></a>00250 <span class="keywordflow">if</span> (this->all_sessions)
276
<a name="l00251"></a>00251 this-><a class="code" href="classschroot_1_1options__base.html#c3c7ef9ab25b573e8d5d3cfbb92510b6" title="Load sessions.">load_sessions</a> = <span class="keyword">true</span>;
277
<a name="l00252"></a>00252 }
278
<a name="l00253"></a>00253 <span class="keywordflow">else</span>
279
<a name="l00254"></a>00254 {
280
<a name="l00255"></a>00255 <span class="comment">// Something went wrong</span>
281
<a name="l00256"></a>00256 this-><a class="code" href="classschroot_1_1options__base.html#24d45cd12a24dde86419543e43b38544" title="Load chroots.">load_chroots</a> = this-><a class="code" href="classschroot_1_1options__base.html#c3c7ef9ab25b573e8d5d3cfbb92510b6" title="Load sessions.">load_sessions</a> = <span class="keyword">false</span>;
282
<a name="l00257"></a>00257 this-><a class="code" href="classschroot_1_1options__base.html#90fd0bc62e0bf5d6d443d9050e3b69a9" title="Use all chroots and sessions.">all</a> = this-><a class="code" href="classschroot_1_1options__base.html#efd0c597bc6296f9f8d6e424f57b82f5" title="Use all chroots.">all_chroots</a> = this-><a class="code" href="classschroot_1_1options__base.html#2252a91f088045f89793cee014c1aebc" title="Use all sessions.">all_sessions</a> = <span class="keyword">false</span>;
283
<a name="l00258"></a>00258 <span class="keywordflow">throw</span> opt::validation_error(_(<span class="stringliteral">"Unknown action specified"</span>));
284
<a name="l00259"></a>00259 }
285
<a name="l00260"></a>00260 }
286
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Sun Jul 8 21:23:55 2007 for schroot by
33
<a name="l00014"></a>00014 <span class="comment"> * along with this program. If not, see</span>
34
<a name="l00015"></a>00015 <span class="comment"> * <http://www.gnu.org/licenses/>.</span>
35
<a name="l00016"></a>00016 <span class="comment"> *</span>
36
<a name="l00017"></a>00017 <span class="comment"> *********************************************************************/</span>
37
<a name="l00018"></a>00018
38
<a name="l00019"></a>00019 <span class="preprocessor">#include <config.h></span>
39
<a name="l00020"></a>00020
40
<a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="schroot-options_8h.html">schroot-options.h</a>"</span>
41
<a name="l00022"></a>00022
42
<a name="l00023"></a>00023 <span class="preprocessor">#include <cstdlib></span>
43
<a name="l00024"></a>00024 <span class="preprocessor">#include <iostream></span>
44
<a name="l00025"></a>00025
45
<a name="l00026"></a>00026 <span class="preprocessor">#include <boost/format.hpp></span>
46
<a name="l00027"></a>00027 <span class="preprocessor">#include <boost/program_options.hpp></span>
47
<a name="l00028"></a>00028
48
<a name="l00029"></a>00029 <span class="keyword">using</span> std::endl;
49
<a name="l00030"></a>00030 <span class="keyword">using</span> boost::format;
50
<a name="l00031"></a>00031 <span class="keyword">using</span> sbuild::_;
51
<a name="l00032"></a>00032 <span class="keyword">namespace </span>opt = boost::program_options;
52
<a name="l00033"></a>00033 <span class="keyword">using namespace </span>schroot;
53
<a name="l00034"></a>00034
54
<a name="l00035"></a>00035 <span class="keyword">const</span> options_base::action_type options_base::ACTION_SESSION_AUTO (<span class="stringliteral">"session_auto"</span>);
55
<a name="l00036"></a>00036 <span class="keyword">const</span> options_base::action_type options_base::ACTION_SESSION_BEGIN (<span class="stringliteral">"session_begin"</span>);
56
<a name="l00037"></a>00037 <span class="keyword">const</span> options_base::action_type options_base::ACTION_SESSION_RECOVER (<span class="stringliteral">"session_recover"</span>);
57
<a name="l00038"></a>00038 <span class="keyword">const</span> options_base::action_type options_base::ACTION_SESSION_RUN (<span class="stringliteral">"session_run"</span>);
58
<a name="l00039"></a>00039 <span class="keyword">const</span> options_base::action_type options_base::ACTION_SESSION_END (<span class="stringliteral">"session_end"</span>);
59
<a name="l00040"></a>00040 <span class="keyword">const</span> options_base::action_type options_base::ACTION_LIST (<span class="stringliteral">"list"</span>);
60
<a name="l00041"></a>00041 <span class="keyword">const</span> options_base::action_type options_base::ACTION_INFO (<span class="stringliteral">"info"</span>);
61
<a name="l00042"></a>00042 <span class="keyword">const</span> options_base::action_type options_base::ACTION_LOCATION (<span class="stringliteral">"location"</span>);
62
<a name="l00043"></a>00043 <span class="keyword">const</span> options_base::action_type options_base::ACTION_CONFIG (<span class="stringliteral">"config"</span>);
63
<a name="l00044"></a>00044
64
<a name="l00045"></a><a class="code" href="classschroot_1_1options__base.html#9afdb9228e0e46d6a829935bde436210">00045</a> options_base::options_base ():
65
<a name="l00046"></a>00046 schroot_base::<a class="code" href="classschroot_1_1options.html" title="schroot command-line options.">options</a> (),
66
<a name="l00047"></a>00047 chroots(),
67
<a name="l00048"></a>00048 command(),
68
<a name="l00049"></a>00049 user(),
69
<a name="l00050"></a>00050 preserve(false),
70
<a name="l00051"></a>00051 all(false),
71
<a name="l00052"></a>00052 all_chroots(false),
72
<a name="l00053"></a>00053 all_sessions(false),
73
<a name="l00054"></a>00054 session_name(),
74
<a name="l00055"></a>00055 session_force(false),
75
<a name="l00056"></a>00056 chroot(_(<span class="stringliteral">"Chroot selection"</span>)),
76
<a name="l00057"></a>00057 chrootenv(_(<span class="stringliteral">"Chroot environment"</span>)),
77
<a name="l00058"></a>00058 session_actions(_(<span class="stringliteral">"Session actions"</span>)),
78
<a name="l00059"></a>00059 session_options(_(<span class="stringliteral">"Session options"</span>))
79
<a name="l00060"></a>00060 {
80
<a name="l00061"></a>00061 }
81
<a name="l00062"></a>00062
82
<a name="l00063"></a><a class="code" href="classschroot_1_1options__base.html#d9c33fd9cc7896cb3fc0d148a98e5ea6">00063</a> <a class="code" href="classschroot_1_1options__base.html#d9c33fd9cc7896cb3fc0d148a98e5ea6" title="The destructor.">options_base::~options_base</a> ()
83
<a name="l00064"></a>00064 {
84
<a name="l00065"></a>00065 }
85
<a name="l00066"></a>00066
86
<a name="l00067"></a>00067 <span class="keywordtype">void</span>
87
<a name="l00068"></a><a class="code" href="classschroot_1_1options__base.html#82640b1848dbba31d5cf38edb9ac08f1">00068</a> <a class="code" href="classschroot_1_1options__base.html#82640b1848dbba31d5cf38edb9ac08f1" title="Add options to option groups.">options_base::add_options</a> ()
88
<a name="l00069"></a>00069 {
89
<a name="l00070"></a>00070 <span class="comment">// Chain up to add basic options.</span>
90
<a name="l00071"></a>00071 <a class="code" href="classschroot__base_1_1options.html#9552a1fefc227463e48e29f4dae89986" title="Add options to option groups.">schroot_base::options::add_options</a>();
91
<a name="l00072"></a>00072
92
<a name="l00073"></a>00073 <a class="code" href="classschroot__base_1_1options.html#5b359a5e43243a64dff27968219735ad" title="Action list.">action</a>.add(<a class="code" href="classschroot_1_1options__base.html#80919c7370c34ed9eda559a51626e83b" title="Begin, run and end a session.">ACTION_SESSION_AUTO</a>);
93
<a name="l00074"></a>00074 <a class="code" href="classschroot__base_1_1options.html#5b359a5e43243a64dff27968219735ad" title="Action list.">action</a>.set_default(<a class="code" href="classschroot_1_1options__base.html#80919c7370c34ed9eda559a51626e83b" title="Begin, run and end a session.">ACTION_SESSION_AUTO</a>);
94
<a name="l00075"></a>00075 <a class="code" href="classschroot__base_1_1options.html#5b359a5e43243a64dff27968219735ad" title="Action list.">action</a>.add(<a class="code" href="classschroot_1_1options__base.html#4b8e1c028c9bd9907118e4bfa9150dbf" title="Begin a session.">ACTION_SESSION_BEGIN</a>);
95
<a name="l00076"></a>00076 <a class="code" href="classschroot__base_1_1options.html#5b359a5e43243a64dff27968219735ad" title="Action list.">action</a>.add(<a class="code" href="classschroot_1_1options__base.html#665269c2416d294d96e3615a76ed1c99" title="Recover an existing session.">ACTION_SESSION_RECOVER</a>);
96
<a name="l00077"></a>00077 <a class="code" href="classschroot__base_1_1options.html#5b359a5e43243a64dff27968219735ad" title="Action list.">action</a>.add(<a class="code" href="classschroot_1_1options__base.html#dffd2e7707484623b402f9776c2a1283" title="Run an existing session.">ACTION_SESSION_RUN</a>);
97
<a name="l00078"></a>00078 <a class="code" href="classschroot__base_1_1options.html#5b359a5e43243a64dff27968219735ad" title="Action list.">action</a>.add(<a class="code" href="classschroot_1_1options__base.html#22317f5a53213c97de5258678de55c56" title="End an existing session.">ACTION_SESSION_END</a>);
98
<a name="l00079"></a>00079 <a class="code" href="classschroot__base_1_1options.html#5b359a5e43243a64dff27968219735ad" title="Action list.">action</a>.add(<a class="code" href="classschroot_1_1options__base.html#29df6276af14260123fe55549260f4cf" title="Display a list of chroots.">ACTION_LIST</a>);
99
<a name="l00080"></a>00080 <a class="code" href="classschroot__base_1_1options.html#5b359a5e43243a64dff27968219735ad" title="Action list.">action</a>.add(<a class="code" href="classschroot_1_1options__base.html#9889bb8cd49347b723f0b014f91fddb3" title="Display chroot information.">ACTION_INFO</a>);
100
<a name="l00081"></a>00081 <a class="code" href="classschroot__base_1_1options.html#5b359a5e43243a64dff27968219735ad" title="Action list.">action</a>.add(<a class="code" href="classschroot_1_1options__base.html#37d022b4ee34451fe63d61737b0faa0c" title="Display chroot location information.">ACTION_LOCATION</a>);
101
<a name="l00082"></a>00082 <a class="code" href="classschroot__base_1_1options.html#5b359a5e43243a64dff27968219735ad" title="Action list.">action</a>.add(<a class="code" href="classschroot_1_1options__base.html#5a050d85d2e6a7920899b901fc28e509" title="Display chroot configuration.">ACTION_CONFIG</a>);
102
<a name="l00083"></a>00083
103
<a name="l00084"></a>00084 <a class="code" href="classschroot__base_1_1options.html#e0290bf2f45c2b3f0958b0e39fe447be" title="Actions options group.">actions</a>.add_options()
104
<a name="l00085"></a>00085 (<span class="stringliteral">"list,l"</span>,
105
<a name="l00086"></a>00086 _(<span class="stringliteral">"List available chroots"</span>))
106
<a name="l00087"></a>00087 (<span class="stringliteral">"info,i"</span>,
107
<a name="l00088"></a>00088 _(<span class="stringliteral">"Show information about selected chroots"</span>))
108
<a name="l00089"></a>00089 (<span class="stringliteral">"config"</span>,
109
<a name="l00090"></a>00090 _(<span class="stringliteral">"Dump configuration of selected chroots"</span>));
110
<a name="l00091"></a>00091
111
<a name="l00092"></a>00092 <a class="code" href="classschroot_1_1options__base.html#10663845e266a779c53580884ce56d0c" title="Chroot options group.">chroot</a>.add_options()
112
<a name="l00093"></a>00093 (<span class="stringliteral">"chroot,c"</span>, opt::value<sbuild::string_list>(&this-><a class="code" href="classschroot_1_1options__base.html#d1832445dd9f7852ec98d62c02eb6960" title="Chroots to use.">chroots</a>),
113
<a name="l00094"></a>00094 _(<span class="stringliteral">"Use specified chroot"</span>));
114
<a name="l00095"></a>00095
115
<a name="l00096"></a>00096 <a class="code" href="classschroot__base_1_1options.html#bf8377656a1eccca804b9b04f1aeb8a8" title="Hidden options group.">hidden</a>.add_options()
116
<a name="l00097"></a>00097 (<span class="stringliteral">"command"</span>, opt::value<sbuild::string_list>(&this-><a class="code" href="classschroot_1_1options__base.html#33f2c84836db46408b58f48e39adee1c" title="Command to run.">command</a>),
117
<a name="l00098"></a>00098 _(<span class="stringliteral">"Command to run"</span>));
118
<a name="l00099"></a>00099
119
<a name="l00100"></a>00100 <a class="code" href="classschroot__base_1_1options.html#d1cb836cb6fa62e3a9f55f41120112f0" title="Positional options group.">positional</a>.add(<span class="stringliteral">"command"</span>, -1);
120
<a name="l00101"></a>00101 }
121
<a name="l00102"></a>00102
122
<a name="l00103"></a>00103 <span class="keywordtype">void</span>
123
<a name="l00104"></a><a class="code" href="classschroot_1_1options__base.html#4df9e636eb67550130db7e5ab1604053">00104</a> <a class="code" href="classschroot_1_1options__base.html#4df9e636eb67550130db7e5ab1604053" title="Add option groups to container groups.">options_base::add_option_groups</a> ()
124
<a name="l00105"></a>00105 {
125
<a name="l00106"></a>00106 <span class="comment">// Chain up to add basic option groups.</span>
126
<a name="l00107"></a>00107 <a class="code" href="classschroot__base_1_1options.html#2b423dd600612e9e574674631ecb0fa9" title="Add option groups to container groups.">schroot_base::options::add_option_groups</a>();
127
<a name="l00108"></a>00108
128
<a name="l00109"></a>00109 <span class="preprocessor">#ifndef BOOST_PROGRAM_OPTIONS_DESCRIPTION_OLD</span>
129
<a name="l00110"></a>00110 <span class="preprocessor"></span> <span class="keywordflow">if</span> (!<a class="code" href="classschroot_1_1options__base.html#10663845e266a779c53580884ce56d0c" title="Chroot options group.">chroot</a>.options().empty())
130
<a name="l00111"></a>00111 #<span class="keywordflow">else</span>
131
<a name="l00112"></a>00112 <span class="keywordflow">if</span> (!<a class="code" href="classschroot_1_1options__base.html#10663845e266a779c53580884ce56d0c" title="Chroot options group.">chroot</a>.primary_keys().empty())
132
<a name="l00113"></a>00113 #endif
133
<a name="l00114"></a>00114 {
134
<a name="l00115"></a>00115 <a class="code" href="classschroot__base_1_1options.html#636feb2ab760a968b53755c3bbe86a0c" title="Visible options container (used for --help).">visible</a>.add(<a class="code" href="classschroot_1_1options__base.html#10663845e266a779c53580884ce56d0c" title="Chroot options group.">chroot</a>);
135
<a name="l00116"></a>00116 <a class="code" href="classschroot__base_1_1options.html#294ade49fac4aa6776cf3cb527d7d6b8" title="Global options container (used for parsing).">global</a>.add(<a class="code" href="classschroot_1_1options__base.html#10663845e266a779c53580884ce56d0c" title="Chroot options group.">chroot</a>);
136
<a name="l00117"></a>00117 }
137
<a name="l00118"></a>00118 <span class="preprocessor">#ifndef BOOST_PROGRAM_OPTIONS_DESCRIPTION_OLD</span>
138
<a name="l00119"></a>00119 <span class="preprocessor"></span> <span class="keywordflow">if</span> (!<a class="code" href="classschroot_1_1options__base.html#3d75a9f784b0ae5e4183cac2aa5c10e8" title="Chroot environment options group.">chrootenv</a>.options().empty())
139
<a name="l00120"></a>00120 #<span class="keywordflow">else</span>
140
<a name="l00121"></a>00121 <span class="keywordflow">if</span> (!<a class="code" href="classschroot_1_1options__base.html#3d75a9f784b0ae5e4183cac2aa5c10e8" title="Chroot environment options group.">chrootenv</a>.primary_keys().empty())
141
<a name="l00122"></a>00122 #endif
142
<a name="l00123"></a>00123 {
143
<a name="l00124"></a>00124 <a class="code" href="classschroot__base_1_1options.html#636feb2ab760a968b53755c3bbe86a0c" title="Visible options container (used for --help).">visible</a>.add(<a class="code" href="classschroot_1_1options__base.html#3d75a9f784b0ae5e4183cac2aa5c10e8" title="Chroot environment options group.">chrootenv</a>);
144
<a name="l00125"></a>00125 <a class="code" href="classschroot__base_1_1options.html#294ade49fac4aa6776cf3cb527d7d6b8" title="Global options container (used for parsing).">global</a>.add(<a class="code" href="classschroot_1_1options__base.html#3d75a9f784b0ae5e4183cac2aa5c10e8" title="Chroot environment options group.">chrootenv</a>);
145
<a name="l00126"></a>00126 }
146
<a name="l00127"></a>00127 <span class="preprocessor">#ifndef BOOST_PROGRAM_OPTIONS_DESCRIPTION_OLD</span>
147
<a name="l00128"></a>00128 <span class="preprocessor"></span> <span class="keywordflow">if</span> (!<a class="code" href="classschroot_1_1options__base.html#f13d1bb6853c45c3860c0e83983d66bf" title="Session actions group.">session_actions</a>.options().empty())
148
<a name="l00129"></a>00129 #<span class="keywordflow">else</span>
149
<a name="l00130"></a>00130 <span class="keywordflow">if</span> (!<a class="code" href="classschroot_1_1options__base.html#f13d1bb6853c45c3860c0e83983d66bf" title="Session actions group.">session_actions</a>.primary_keys().empty())
150
<a name="l00131"></a>00131 #endif
151
<a name="l00132"></a>00132 {
152
<a name="l00133"></a>00133 <a class="code" href="classschroot__base_1_1options.html#636feb2ab760a968b53755c3bbe86a0c" title="Visible options container (used for --help).">visible</a>.add(<a class="code" href="classschroot_1_1options__base.html#f13d1bb6853c45c3860c0e83983d66bf" title="Session actions group.">session_actions</a>);
153
<a name="l00134"></a>00134 <a class="code" href="classschroot__base_1_1options.html#294ade49fac4aa6776cf3cb527d7d6b8" title="Global options container (used for parsing).">global</a>.add(<a class="code" href="classschroot_1_1options__base.html#f13d1bb6853c45c3860c0e83983d66bf" title="Session actions group.">session_actions</a>);
154
<a name="l00135"></a>00135 }
155
<a name="l00136"></a>00136
156
<a name="l00137"></a>00137 <span class="preprocessor">#ifndef BOOST_PROGRAM_OPTIONS_DESCRIPTION_OLD</span>
157
<a name="l00138"></a>00138 <span class="preprocessor"></span> <span class="keywordflow">if</span> (!<a class="code" href="classschroot_1_1options__base.html#9ecda5b919371290e3e958c76a1342ca" title="Session options group.">session_options</a>.options().empty())
158
<a name="l00139"></a>00139 #<span class="keywordflow">else</span>
159
<a name="l00140"></a>00140 <span class="keywordflow">if</span> (!<a class="code" href="classschroot_1_1options__base.html#9ecda5b919371290e3e958c76a1342ca" title="Session options group.">session_options</a>.primary_keys().empty())
160
<a name="l00141"></a>00141 #endif
161
<a name="l00142"></a>00142 {
162
<a name="l00143"></a>00143 <a class="code" href="classschroot__base_1_1options.html#636feb2ab760a968b53755c3bbe86a0c" title="Visible options container (used for --help).">visible</a>.add(<a class="code" href="classschroot_1_1options__base.html#9ecda5b919371290e3e958c76a1342ca" title="Session options group.">session_options</a>);
163
<a name="l00144"></a>00144 <a class="code" href="classschroot__base_1_1options.html#294ade49fac4aa6776cf3cb527d7d6b8" title="Global options container (used for parsing).">global</a>.add(<a class="code" href="classschroot_1_1options__base.html#9ecda5b919371290e3e958c76a1342ca" title="Session options group.">session_options</a>);
164
<a name="l00145"></a><a class="code" href="classschroot_1_1options__base.html#23b25578749ce4563737f3f35c7b0354">00145</a> }
165
<a name="l00146"></a>00146 }
166
<a name="l00147"></a>00147
167
<a name="l00148"></a>00148 <span class="keywordtype">void</span>
168
<a name="l00149"></a>00149 <a class="code" href="classschroot_1_1options__base.html#23b25578749ce4563737f3f35c7b0354" title="Check options after parsing.">options_base::check_options</a> ()
169
<a name="l00150"></a>00150 {
170
<a name="l00151"></a>00151 <span class="comment">// Chain up to check basic options.</span>
171
<a name="l00152"></a>00152 <a class="code" href="classschroot__base_1_1options.html#f4d23a59c343dd177d1041557c8f5f25" title="Check options after parsing.">schroot_base::options::check_options</a>();
172
<a name="l00153"></a>00153
173
<a name="l00154"></a>00154 <span class="keywordflow">if</span> (<a class="code" href="classschroot__base_1_1options.html#7210f17e844a945faaa240e22ed9d27a" title="Variables map, filled during parsing.">vm</a>.count(<span class="stringliteral">"list"</span>))
174
<a name="l00155"></a>00155 this->action = <a class="code" href="classschroot_1_1options__base.html#29df6276af14260123fe55549260f4cf" title="Display a list of chroots.">ACTION_LIST</a>;
175
<a name="l00156"></a>00156 if (<a class="code" href="classschroot__base_1_1options.html#7210f17e844a945faaa240e22ed9d27a" title="Variables map, filled during parsing.">vm</a>.count(<span class="stringliteral">"info"</span>))
176
<a name="l00157"></a>00157 this->action = <a class="code" href="classschroot_1_1options__base.html#9889bb8cd49347b723f0b014f91fddb3" title="Display chroot information.">ACTION_INFO</a>;
177
<a name="l00158"></a>00158 if (<a class="code" href="classschroot__base_1_1options.html#7210f17e844a945faaa240e22ed9d27a" title="Variables map, filled during parsing.">vm</a>.count(<span class="stringliteral">"config"</span>))
178
<a name="l00159"></a><a class="code" href="classschroot_1_1options__base.html#3ba2359ad555baf51c4f019a1b47b212">00159</a> this->action = <a class="code" href="classschroot_1_1options__base.html#5a050d85d2e6a7920899b901fc28e509" title="Display chroot configuration.">ACTION_CONFIG</a>;
179
<a name="l00160"></a>00160 }
180
<a name="l00161"></a>00161
181
<a name="l00162"></a>00162 <span class="keywordtype">void</span>
182
<a name="l00163"></a>00163 <a class="code" href="classschroot_1_1options__base.html#3ba2359ad555baf51c4f019a1b47b212" title="Check actions after parsing.">options_base::check_actions</a> ()
183
<a name="l00164"></a>00164 {
184
<a name="l00165"></a>00165 <span class="comment">// Chain up to check basic actions.</span>
185
<a name="l00166"></a>00166 <a class="code" href="classschroot__base_1_1options.html#24c0c4b9f1758a932ad0cc9e2b24655e" title="Check actions after parsing.">schroot_base::options::check_actions</a>();
186
<a name="l00167"></a>00167
187
<a name="l00168"></a>00168 <span class="keywordflow">if</span> (this->quiet && this->verbose)
188
<a name="l00169"></a>00169 {
189
<a name="l00170"></a>00170 <a class="codeRef" doxygen="sbuild.tag:/tmp/sb/schroot/doc/sbuild/html/" href="/tmp/sb/schroot/doc/sbuild/html/namespacesbuild.html#133a221b9d5fbd4756937f2ec0a02958">sbuild::log_warning</a>()
190
<a name="l00171"></a>00171 << _(<span class="stringliteral">"--quiet and --verbose may not be used at the same time"</span>)
191
<a name="l00172"></a>00172 << endl;
192
<a name="l00173"></a>00173 <a class="codeRef" doxygen="sbuild.tag:/tmp/sb/schroot/doc/sbuild/html/" href="/tmp/sb/schroot/doc/sbuild/html/namespacesbuild.html#4b668d467f8c9c6063cd2c9c7aaf3086">sbuild::log_info</a>() << _(<span class="stringliteral">"Using verbose output"</span>) << endl;
193
<a name="l00174"></a>00174 }
194
<a name="l00175"></a>00175
195
<a name="l00176"></a>00176 <span class="keywordflow">if</span> (!this->chroots.empty() && <a class="code" href="classschroot_1_1options__base.html#84d237d76c893c633aca580118096aa8" title="Check if any of the --all options have been used.">all_used</a>())
196
<a name="l00177"></a>00177 {
197
<a name="l00178"></a>00178 <a class="codeRef" doxygen="sbuild.tag:/tmp/sb/schroot/doc/sbuild/html/" href="/tmp/sb/schroot/doc/sbuild/html/namespacesbuild.html#133a221b9d5fbd4756937f2ec0a02958">sbuild::log_warning</a>()
198
<a name="l00179"></a>00179 << _(<span class="stringliteral">"--chroot and --all may not be used at the same time"</span>)
199
<a name="l00180"></a>00180 << endl;
200
<a name="l00181"></a>00181 <a class="codeRef" doxygen="sbuild.tag:/tmp/sb/schroot/doc/sbuild/html/" href="/tmp/sb/schroot/doc/sbuild/html/namespacesbuild.html#4b668d467f8c9c6063cd2c9c7aaf3086">sbuild::log_info</a>() << _(<span class="stringliteral">"Using --chroots only"</span>) << endl;
201
<a name="l00182"></a>00182 this-><a class="code" href="classschroot_1_1options__base.html#90fd0bc62e0bf5d6d443d9050e3b69a9" title="Use all chroots and sessions.">all</a> = this-><a class="code" href="classschroot_1_1options__base.html#efd0c597bc6296f9f8d6e424f57b82f5" title="Use all chroots.">all_chroots</a> = this-><a class="code" href="classschroot_1_1options__base.html#2252a91f088045f89793cee014c1aebc" title="Use all sessions.">all_sessions</a> = <span class="keyword">false</span>;
202
<a name="l00183"></a>00183 }
203
<a name="l00184"></a>00184
204
<a name="l00185"></a>00185 <span class="comment">/* Determine which chroots to load and use. */</span>
205
<a name="l00186"></a>00186 <span class="keywordflow">if</span> (this->action == <a class="code" href="classschroot_1_1options__base.html#80919c7370c34ed9eda559a51626e83b" title="Begin, run and end a session.">ACTION_SESSION_AUTO</a>)
206
<a name="l00187"></a>00187 {
207
<a name="l00188"></a>00188 <span class="comment">// Only allow normal chroots</span>
208
<a name="l00189"></a>00189 this-><a class="code" href="classschroot_1_1options__base.html#24d45cd12a24dde86419543e43b38544" title="Load chroots.">load_chroots</a> = <span class="keyword">true</span>;
209
<a name="l00190"></a>00190 this-><a class="code" href="classschroot_1_1options__base.html#c3c7ef9ab25b573e8d5d3cfbb92510b6" title="Load sessions.">load_sessions</a> = <span class="keyword">false</span>;
210
<a name="l00191"></a>00191 this-><a class="code" href="classschroot_1_1options__base.html#90fd0bc62e0bf5d6d443d9050e3b69a9" title="Use all chroots and sessions.">all</a> = this-><a class="code" href="classschroot_1_1options__base.html#2252a91f088045f89793cee014c1aebc" title="Use all sessions.">all_sessions</a> = <span class="keyword">false</span>;
211
<a name="l00192"></a>00192
212
<a name="l00193"></a>00193 <span class="comment">// If no chroot was specified, fall back to the "default" chroot.</span>
213
<a name="l00194"></a>00194 <span class="keywordflow">if</span> (this->chroots.empty() && <a class="code" href="classschroot_1_1options__base.html#84d237d76c893c633aca580118096aa8" title="Check if any of the --all options have been used.">all_used</a>() == <span class="keyword">false</span>)
214
<a name="l00195"></a>00195 this->chroots.push_back(<span class="stringliteral">"default"</span>);
215
<a name="l00196"></a>00196 }
216
<a name="l00197"></a>00197 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (this->action == <a class="code" href="classschroot_1_1options__base.html#4b8e1c028c9bd9907118e4bfa9150dbf" title="Begin a session.">ACTION_SESSION_BEGIN</a>)
217
<a name="l00198"></a>00198 {
218
<a name="l00199"></a>00199 <span class="comment">// Only allow one session chroot</span>
219
<a name="l00200"></a>00200 this-><a class="code" href="classschroot_1_1options__base.html#24d45cd12a24dde86419543e43b38544" title="Load chroots.">load_chroots</a> = <span class="keyword">true</span>;
220
<a name="l00201"></a>00201 this-><a class="code" href="classschroot_1_1options__base.html#c3c7ef9ab25b573e8d5d3cfbb92510b6" title="Load sessions.">load_sessions</a> = <span class="keyword">false</span>;
221
<a name="l00202"></a>00202 <span class="keywordflow">if</span> (this->chroots.size() != 1 || <a class="code" href="classschroot_1_1options__base.html#84d237d76c893c633aca580118096aa8" title="Check if any of the --all options have been used.">all_used</a>())
222
<a name="l00203"></a>00203 <span class="keywordflow">throw</span> opt::validation_error(_(<span class="stringliteral">"Exactly one chroot must be specified when beginning a session"</span>));
223
<a name="l00204"></a>00204
224
<a name="l00205"></a>00205 this-><a class="code" href="classschroot_1_1options__base.html#90fd0bc62e0bf5d6d443d9050e3b69a9" title="Use all chroots and sessions.">all</a> = this-><a class="code" href="classschroot_1_1options__base.html#efd0c597bc6296f9f8d6e424f57b82f5" title="Use all chroots.">all_chroots</a> = this-><a class="code" href="classschroot_1_1options__base.html#2252a91f088045f89793cee014c1aebc" title="Use all sessions.">all_sessions</a> = <span class="keyword">false</span>;
225
<a name="l00206"></a>00206 }
226
<a name="l00207"></a>00207 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (this->action == <a class="code" href="classschroot_1_1options__base.html#665269c2416d294d96e3615a76ed1c99" title="Recover an existing session.">ACTION_SESSION_RECOVER</a> ||
227
<a name="l00208"></a>00208 this->action == <a class="code" href="classschroot_1_1options__base.html#dffd2e7707484623b402f9776c2a1283" title="Run an existing session.">ACTION_SESSION_RUN</a> ||
228
<a name="l00209"></a>00209 this->action == <a class="code" href="classschroot_1_1options__base.html#22317f5a53213c97de5258678de55c56" title="End an existing session.">ACTION_SESSION_END</a>)
229
<a name="l00210"></a>00210 {
230
<a name="l00211"></a>00211 <span class="comment">// Session operations work on all chroots.</span>
231
<a name="l00212"></a>00212 this-><a class="code" href="classschroot_1_1options__base.html#24d45cd12a24dde86419543e43b38544" title="Load chroots.">load_chroots</a> = this-><a class="code" href="classschroot_1_1options__base.html#c3c7ef9ab25b573e8d5d3cfbb92510b6" title="Load sessions.">load_sessions</a> = <span class="keyword">true</span>;
232
<a name="l00213"></a>00213 }
233
<a name="l00214"></a>00214 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (this->action == <a class="code" href="classschroot__base_1_1options.html#4c1f304c9f30b5965dcb7bbf51554124" title="Display program help.">ACTION_HELP</a> ||
234
<a name="l00215"></a>00215 this->action == <a class="code" href="classschroot__base_1_1options.html#1064a6609731fbc80abb0c849ff3a3f8" title="Display program version.">ACTION_VERSION</a>)
235
<a name="l00216"></a>00216 {
236
<a name="l00217"></a>00217 <span class="comment">// Chroots don't make sense here.</span>
237
<a name="l00218"></a>00218 this-><a class="code" href="classschroot_1_1options__base.html#24d45cd12a24dde86419543e43b38544" title="Load chroots.">load_chroots</a> = this-><a class="code" href="classschroot_1_1options__base.html#c3c7ef9ab25b573e8d5d3cfbb92510b6" title="Load sessions.">load_sessions</a> = <span class="keyword">false</span>;
238
<a name="l00219"></a>00219 this-><a class="code" href="classschroot_1_1options__base.html#90fd0bc62e0bf5d6d443d9050e3b69a9" title="Use all chroots and sessions.">all</a> = this-><a class="code" href="classschroot_1_1options__base.html#efd0c597bc6296f9f8d6e424f57b82f5" title="Use all chroots.">all_chroots</a> = this-><a class="code" href="classschroot_1_1options__base.html#2252a91f088045f89793cee014c1aebc" title="Use all sessions.">all_sessions</a> = <span class="keyword">false</span>;
239
<a name="l00220"></a>00220 }
240
<a name="l00221"></a>00221 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (this->action == <a class="code" href="classschroot_1_1options__base.html#29df6276af14260123fe55549260f4cf" title="Display a list of chroots.">ACTION_LIST</a>)
241
<a name="l00222"></a>00222 {
242
<a name="l00223"></a>00223 <span class="comment">// If not specified otherwise, load normal chroots, but allow</span>
243
<a name="l00224"></a>00224 <span class="comment">// --all options.</span>
244
<a name="l00225"></a>00225 <span class="keywordflow">if</span> (!<a class="code" href="classschroot_1_1options__base.html#84d237d76c893c633aca580118096aa8" title="Check if any of the --all options have been used.">all_used</a>())
245
<a name="l00226"></a>00226 this->load_chroots = <span class="keyword">true</span>;
246
<a name="l00227"></a>00227 if (this->all_chroots)
247
<a name="l00228"></a>00228 this-><a class="code" href="classschroot_1_1options__base.html#24d45cd12a24dde86419543e43b38544" title="Load chroots.">load_chroots</a> = <span class="keyword">true</span>;
248
<a name="l00229"></a>00229 <span class="keywordflow">if</span> (this->all_sessions)
249
<a name="l00230"></a>00230 this-><a class="code" href="classschroot_1_1options__base.html#c3c7ef9ab25b573e8d5d3cfbb92510b6" title="Load sessions.">load_sessions</a> = <span class="keyword">true</span>;
250
<a name="l00231"></a>00231 <span class="keywordflow">if</span> (!this->chroots.empty())
251
<a name="l00232"></a>00232 <span class="keywordflow">throw</span> opt::validation_error(_(<span class="stringliteral">"--chroot may not be used with --list"</span>));
252
<a name="l00233"></a>00233 }
253
<a name="l00234"></a>00234 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (this->action == <a class="code" href="classschroot_1_1options__base.html#9889bb8cd49347b723f0b014f91fddb3" title="Display chroot information.">ACTION_INFO</a> ||
254
<a name="l00235"></a>00235 this->action == <a class="code" href="classschroot_1_1options__base.html#37d022b4ee34451fe63d61737b0faa0c" title="Display chroot location information.">ACTION_LOCATION</a> ||
255
<a name="l00236"></a>00236 this->action == <a class="code" href="classschroot_1_1options__base.html#5a050d85d2e6a7920899b901fc28e509" title="Display chroot configuration.">ACTION_CONFIG</a>)
256
<a name="l00237"></a>00237 {
257
<a name="l00238"></a>00238 <span class="comment">// If not specified otherwise, load normal chroots, but allow</span>
258
<a name="l00239"></a>00239 <span class="comment">// --all options.</span>
259
<a name="l00240"></a>00240 <span class="keywordflow">if</span> (!this->chroots.empty()) <span class="comment">// chroot specified</span>
260
<a name="l00241"></a>00241 this->load_chroots = this->load_sessions = <span class="keyword">true</span>;
261
<a name="l00242"></a>00242 <span class="keywordflow">else</span> if (!<a class="code" href="classschroot_1_1options__base.html#84d237d76c893c633aca580118096aa8" title="Check if any of the --all options have been used.">all_used</a>()) <span class="comment">// no chroots specified</span>
262
<a name="l00243"></a>00243 {
263
<a name="l00244"></a>00244 this-><a class="code" href="classschroot_1_1options__base.html#efd0c597bc6296f9f8d6e424f57b82f5" title="Use all chroots.">all_chroots</a> = <span class="keyword">true</span>;
264
<a name="l00245"></a>00245 this-><a class="code" href="classschroot_1_1options__base.html#24d45cd12a24dde86419543e43b38544" title="Load chroots.">load_chroots</a> = <span class="keyword">true</span>;
265
<a name="l00246"></a>00246 }
266
<a name="l00247"></a>00247 <span class="keywordflow">if</span> (this->all_chroots)
267
<a name="l00248"></a>00248 this-><a class="code" href="classschroot_1_1options__base.html#24d45cd12a24dde86419543e43b38544" title="Load chroots.">load_chroots</a> = <span class="keyword">true</span>;
268
<a name="l00249"></a>00249 <span class="keywordflow">if</span> (this->all_sessions)
269
<a name="l00250"></a>00250 this-><a class="code" href="classschroot_1_1options__base.html#c3c7ef9ab25b573e8d5d3cfbb92510b6" title="Load sessions.">load_sessions</a> = <span class="keyword">true</span>;
270
<a name="l00251"></a>00251 }
271
<a name="l00252"></a>00252 <span class="keywordflow">else</span>
272
<a name="l00253"></a>00253 {
273
<a name="l00254"></a>00254 <span class="comment">// Something went wrong</span>
274
<a name="l00255"></a>00255 this-><a class="code" href="classschroot_1_1options__base.html#24d45cd12a24dde86419543e43b38544" title="Load chroots.">load_chroots</a> = this-><a class="code" href="classschroot_1_1options__base.html#c3c7ef9ab25b573e8d5d3cfbb92510b6" title="Load sessions.">load_sessions</a> = <span class="keyword">false</span>;
275
<a name="l00256"></a>00256 this-><a class="code" href="classschroot_1_1options__base.html#90fd0bc62e0bf5d6d443d9050e3b69a9" title="Use all chroots and sessions.">all</a> = this-><a class="code" href="classschroot_1_1options__base.html#efd0c597bc6296f9f8d6e424f57b82f5" title="Use all chroots.">all_chroots</a> = this-><a class="code" href="classschroot_1_1options__base.html#2252a91f088045f89793cee014c1aebc" title="Use all sessions.">all_sessions</a> = <span class="keyword">false</span>;
276
<a name="l00257"></a>00257 <span class="keywordflow">throw</span> opt::validation_error(_(<span class="stringliteral">"Unknown action specified"</span>));
277
<a name="l00258"></a>00258 }
278
<a name="l00259"></a>00259 }
279
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Mon Jan 21 00:38:29 2008 for schroot by
287
280
<a href="http://www.doxygen.org/index.html">
288
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.2 </small></address>
281
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.4 </small></address>