The Battle for Wesnoth  1.15.1+dev
test_commandline_options.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2018 by Lukasz Dobrogowski <lukasz.dobrogowski@gmail.com>
3  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 #define GETTEXT_DOMAIN "wesnoth-test"
15 
16 #include "commandline_options.hpp"
17 
18 #include <boost/test/unit_test.hpp>
19 #include <boost/assign.hpp>
20 
21 BOOST_AUTO_TEST_SUITE( cmdline_opts )
22 
23 BOOST_AUTO_TEST_CASE (test_empty_options)
24 {
25 
26  std::vector<std::string> args {"wesnoth"};
27  commandline_options co(args);
28 
29  BOOST_CHECK(!co.campaign);
30  BOOST_CHECK(!co.campaign_difficulty);
31  BOOST_CHECK(!co.campaign_scenario);
32  BOOST_CHECK(!co.campaign_skip_story);
33  BOOST_CHECK(!co.clock);
34  BOOST_CHECK(!co.data_dir);
35  BOOST_CHECK(!co.data_path);
36  BOOST_CHECK(!co.debug);
37 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
38  BOOST_CHECK(!co.debug_dot_domain);
39  BOOST_CHECK(!co.debug_dot_level);
40 #endif
41  BOOST_CHECK(!co.editor);
42  BOOST_CHECK(!co.fps);
43  BOOST_CHECK(!co.fullscreen);
44  BOOST_CHECK(!co.gunzip);
45  BOOST_CHECK(!co.gzip);
46  BOOST_CHECK(!co.help);
47  BOOST_CHECK(!co.load);
48  BOOST_CHECK(!co.log);
49  BOOST_CHECK(!co.logdomains);
50  BOOST_CHECK(!co.multiplayer);
51  BOOST_CHECK(!co.multiplayer_ai_config);
52  BOOST_CHECK(!co.multiplayer_algorithm);
53  BOOST_CHECK(!co.multiplayer_controller);
54  BOOST_CHECK(!co.multiplayer_era);
55  BOOST_CHECK(!co.multiplayer_exit_at_end);
56  BOOST_CHECK(!co.multiplayer_ignore_map_settings);
57  BOOST_CHECK(!co.multiplayer_label);
58  BOOST_CHECK(!co.multiplayer_parm);
59  BOOST_CHECK(!co.multiplayer_side);
60  BOOST_CHECK(!co.multiplayer_turns);
61  BOOST_CHECK(!co.max_fps);
62  BOOST_CHECK(!co.nocache);
63  BOOST_CHECK(!co.nodelay);
64  BOOST_CHECK(!co.nogui);
65  BOOST_CHECK(!co.nomusic);
66  BOOST_CHECK(!co.nosound);
67  BOOST_CHECK(!co.new_widgets);
68  BOOST_CHECK(!co.preprocess);
69  BOOST_CHECK(!co.preprocess_defines);
70  BOOST_CHECK(!co.preprocess_input_macros);
71  BOOST_CHECK(!co.preprocess_output_macros);
72  BOOST_CHECK(!co.preprocess_path);
73  BOOST_CHECK(!co.preprocess_target);
74  BOOST_CHECK(!co.resolution);
75  BOOST_CHECK(!co.rng_seed);
76  BOOST_CHECK(!co.multiplayer_scenario);
77  BOOST_CHECK(!co.server);
78  BOOST_CHECK(!co.screenshot);
79  BOOST_CHECK(!co.screenshot_map_file);
80  BOOST_CHECK(!co.screenshot_output_file);
81  BOOST_CHECK(!co.test);
82  BOOST_CHECK(!co.userconfig_dir);
83  BOOST_CHECK(!co.userconfig_path);
84  BOOST_CHECK(!co.userdata_dir);
85  BOOST_CHECK(!co.userdata_path);
86  BOOST_CHECK(!co.validcache);
87  BOOST_CHECK(!co.version);
88  BOOST_CHECK(!co.windowed);
89  BOOST_CHECK(!co.with_replay);
90 }
91 
92 BOOST_AUTO_TEST_CASE (test_default_options)
93 {
94  std::vector<std::string> args {
95  "wesnoth",
96  "--campaign",
97  "--editor",
98  "--logdomains",
99  "--preprocess-output-macros",
100  "--server",
101  "--test"};
102 
103  commandline_options co(args);
104  BOOST_CHECK(co.campaign && co.campaign->empty());
105  BOOST_CHECK(!co.campaign_difficulty);
106  BOOST_CHECK(!co.campaign_scenario);
107  BOOST_CHECK(!co.campaign_skip_story);
108  BOOST_CHECK(!co.clock);
109  BOOST_CHECK(!co.data_dir);
110  BOOST_CHECK(!co.data_path);
111  BOOST_CHECK(!co.debug);
112 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
113  BOOST_CHECK(!co.debug_dot_domain);
114  BOOST_CHECK(!co.debug_dot_level);
115 #endif
116  BOOST_CHECK(co.editor && co.editor->empty());
117  BOOST_CHECK(!co.fps);
118  BOOST_CHECK(!co.fullscreen);
119  BOOST_CHECK(!co.gunzip);
120  BOOST_CHECK(!co.gzip);
121  BOOST_CHECK(!co.help);
122  BOOST_CHECK(!co.load);
123  BOOST_CHECK(!co.log);
124  BOOST_CHECK(co.logdomains && co.logdomains->empty());
125  BOOST_CHECK(!co.multiplayer);
126  BOOST_CHECK(!co.multiplayer_ai_config);
127  BOOST_CHECK(!co.multiplayer_algorithm);
128  BOOST_CHECK(!co.multiplayer_controller);
129  BOOST_CHECK(!co.multiplayer_era);
130  BOOST_CHECK(!co.multiplayer_exit_at_end);
131  BOOST_CHECK(!co.multiplayer_ignore_map_settings);
132  BOOST_CHECK(!co.multiplayer_label);
133  BOOST_CHECK(!co.multiplayer_parm);
134  BOOST_CHECK(!co.multiplayer_scenario);
135  BOOST_CHECK(!co.multiplayer_side);
136  BOOST_CHECK(!co.multiplayer_turns);
137  BOOST_CHECK(!co.max_fps);
138  BOOST_CHECK(!co.nocache);
139  BOOST_CHECK(!co.nodelay);
140  BOOST_CHECK(!co.nogui);
141  BOOST_CHECK(!co.nomusic);
142  BOOST_CHECK(!co.nosound);
143  BOOST_CHECK(!co.new_widgets);
144  BOOST_CHECK(!co.preprocess);
145  BOOST_CHECK(!co.preprocess_defines);
146  BOOST_CHECK(!co.preprocess_input_macros);
147  BOOST_CHECK(co.preprocess_output_macros && co.preprocess_output_macros->empty());
148  BOOST_CHECK(!co.preprocess_path);
149  BOOST_CHECK(!co.preprocess_target);
150  BOOST_CHECK(!co.resolution);
151  BOOST_CHECK(!co.rng_seed);
152  BOOST_CHECK(co.server && co.server->empty());
153  BOOST_CHECK(!co.screenshot);
154  BOOST_CHECK(!co.screenshot_map_file);
155  BOOST_CHECK(!co.screenshot_output_file);
156  BOOST_CHECK(co.test && co.test->empty());
157  BOOST_CHECK(!co.userconfig_dir);
158  BOOST_CHECK(!co.userconfig_path);
159  BOOST_CHECK(!co.userdata_dir);
160  BOOST_CHECK(!co.userdata_path);
161  BOOST_CHECK(!co.validcache);
162  BOOST_CHECK(!co.version);
163  BOOST_CHECK(!co.windowed);
164  BOOST_CHECK(!co.with_replay);
165 }
166 
167 BOOST_AUTO_TEST_CASE (test_full_options)
168 {
169  std::vector<std::string> args {
170  "wesnoth",
171  "--ai-config=1:aifoo",
172  "--ai-config=2:aibar",
173  "--algorithm=3:algfoo",
174  "--algorithm=4:algbar",
175  "--campaign=campfoo",
176  "--campaign-difficulty=16",
177  "--campaign-scenario=scenfoo",
178  "--campaign-skip-story",
179  "--clock",
180  "--controller=5:confoo",
181  "--controller=6:conbar",
182  "--data-dir=datadirfoo",
183  "--data-path",
184  "--debug",
185 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
186  "--debug-dot-domain=ddfoo",
187  "--debug-dot-level=dlfoo",
188 #endif
189  "--editor=editfoo",
190  "--era=erafoo",
191  "--exit-at-end",
192  "--fps",
193  "--fullscreen",
194  "--gunzip=gunzipfoo.gz",
195  "--gzip=gzipfoo",
196  "--help",
197  "--ignore-map-settings",
198  "--label=labelfoo",
199  "--load=loadfoo",
200  "--log-error=errfoo,errbar/*",
201  "--log-warning=warnfoo,warnfoo/bar",
202  "--log-info=infofoo",
203  "--log-debug=dbgfoo,dbgbar,dbg/foo/bar/baz",
204  "--logdomains=filterfoo",
205  "--max-fps=100",
206  "--multiplayer",
207  "--new-widgets",
208  "--nocache",
209  "--nodelay",
210  "--nomusic",
211  "--nosound",
212  "--nogui",
213  "--parm=7:parmfoo:valfoo",
214  "--parm=8:parmbar:valbar",
215  "--preprocess", "preppathfoo", "preptargfoo",
216  "--preprocess-defines=DEFFOO,DEFBAR",
217  "--preprocess-input-macros=inmfoo",
218  "--preprocess-output-macros=outmfoo",
219  "--resolution=800x600",
220  "--rng-seed=1234",
221  "--scenario=scenfoo",
222  "--screenshot", "mapfoo", "outssfoo",
223  "--side=9:sidefoo",
224  "--side=10:sidebar",
225  "--server=servfoo",
226  "--test=testfoo",
227  "--turns=42",
228  "--userconfig-dir=userconfigdirfoo",
229  "--userconfig-path",
230  "--userdata-dir=userdatadirfoo",
231  "--userdata-path",
232  "--validcache",
233  "--version",
234  "--windowed",
235  "--with-replay"};
236 
237  commandline_options co(args);
238 
239  BOOST_CHECK(co.campaign && *co.campaign == "campfoo");
240  BOOST_CHECK(co.campaign_difficulty && *co.campaign_difficulty == 16);
241  BOOST_CHECK(co.campaign_scenario && *co.campaign_scenario == "scenfoo");
242  BOOST_CHECK(co.campaign_skip_story);
243  BOOST_CHECK(co.clock);
244  BOOST_CHECK(co.data_dir && *co.data_dir == "datadirfoo");
245  BOOST_CHECK(co.data_path);
246  BOOST_CHECK(co.debug);
247 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
248  BOOST_CHECK(co.debug_dot_domain && *co.debug_dot_domain == "ddfoo");
249  BOOST_CHECK(co.debug_dot_level && *co.debug_dot_level == "dlfoo");
250 #endif
251  BOOST_CHECK(co.editor && *co.editor == "editfoo");
252  BOOST_CHECK(co.fps);
253  BOOST_CHECK(co.fullscreen);
254  BOOST_CHECK(co.gunzip && *co.gunzip == "gunzipfoo.gz");
255  BOOST_CHECK(co.gzip && *co.gzip == "gzipfoo");
256  BOOST_CHECK(co.help);
257  BOOST_CHECK(co.load && *co.load == "loadfoo");
258  BOOST_CHECK(co.log);
259  BOOST_CHECK(co.log->size()==8);
260  BOOST_CHECK(co.log->at(0).first == 0 && co.log->at(1).first == 0);
261  BOOST_CHECK(co.log->at(0).second == "errfoo" && co.log->at(1).second == "errbar/*");
262  BOOST_CHECK(co.log->at(2).first == 1 && co.log->at(3).first == 1);
263  BOOST_CHECK(co.log->at(2).second == "warnfoo" && co.log->at(3).second == "warnfoo/bar");
264  BOOST_CHECK(co.log->at(4).first == 2);
265  BOOST_CHECK(co.log->at(4).second == "infofoo");
266  BOOST_CHECK(co.log->at(5).first == 3 && co.log->at(6).first == 3 && co.log->at(7).first == 3);
267  BOOST_CHECK(co.log->at(5).second == "dbgfoo" && co.log->at(6).second == "dbgbar" && co.log->at(7).second == "dbg/foo/bar/baz");
268  BOOST_CHECK(co.logdomains && *co.logdomains == "filterfoo");
269  BOOST_CHECK(co.multiplayer);
270  BOOST_CHECK(co.multiplayer_ai_config);
271  BOOST_CHECK(co.multiplayer_ai_config->size() == 2);
272  BOOST_CHECK(co.multiplayer_ai_config->at(0).first == 1 && co.multiplayer_ai_config->at(0).second == "aifoo");
273  BOOST_CHECK(co.multiplayer_ai_config->at(1).first == 2 && co.multiplayer_ai_config->at(1).second == "aibar");
274  BOOST_CHECK(co.multiplayer_algorithm);
275  BOOST_CHECK(co.multiplayer_algorithm->at(0).first == 3 && co.multiplayer_algorithm->at(0).second == "algfoo");
276  BOOST_CHECK(co.multiplayer_algorithm->at(1).first == 4 && co.multiplayer_algorithm->at(1).second == "algbar");
277  BOOST_CHECK(co.multiplayer_controller);
278  BOOST_CHECK(co.multiplayer_controller->at(0).first == 5 && co.multiplayer_controller->at(0).second == "confoo");
279  BOOST_CHECK(co.multiplayer_controller->at(1).first == 6 && co.multiplayer_controller->at(1).second == "conbar");
280  BOOST_CHECK(co.multiplayer_era && *co.multiplayer_era == "erafoo");
281  BOOST_CHECK(co.multiplayer_exit_at_end);
282  BOOST_CHECK(co.multiplayer_ignore_map_settings);
283  BOOST_CHECK(co.multiplayer_label && *co.multiplayer_label == "labelfoo");
284  BOOST_CHECK(co.multiplayer_parm);
285  BOOST_CHECK(std::get<0>(co.multiplayer_parm->at(0)) == 7 && std::get<1>(co.multiplayer_parm->at(0)) == "parmfoo" && std::get<2>(co.multiplayer_parm->at(0)) == "valfoo");
286  BOOST_CHECK(std::get<0>(co.multiplayer_parm->at(1)) == 8 && std::get<1>(co.multiplayer_parm->at(1)) == "parmbar" && std::get<2>(co.multiplayer_parm->at(1)) == "valbar");
287  BOOST_CHECK(co.multiplayer_scenario && *co.multiplayer_scenario == "scenfoo");
288  BOOST_CHECK(co.multiplayer_side);
289  BOOST_CHECK(co.multiplayer_side->size() == 2);
290  BOOST_CHECK(co.multiplayer_side->at(0).first == 9 && co.multiplayer_side->at(0).second == "sidefoo");
291  BOOST_CHECK(co.multiplayer_side->at(1).first == 10 && co.multiplayer_side->at(1).second == "sidebar");
292  BOOST_CHECK(co.multiplayer_turns && *co.multiplayer_turns == "42");
293  BOOST_CHECK(co.max_fps && *co.max_fps == 100);
294  BOOST_CHECK(co.nocache);
295  BOOST_CHECK(co.nodelay);
296  BOOST_CHECK(co.nogui);
297  BOOST_CHECK(co.nomusic);
298  BOOST_CHECK(co.nosound);
299  BOOST_CHECK(co.new_widgets);
300  BOOST_CHECK(co.preprocess && co.preprocess_path && co.preprocess_target);
301  BOOST_CHECK(*co.preprocess_path == "preppathfoo" && *co.preprocess_target == "preptargfoo");
302  BOOST_CHECK(co.preprocess_defines && co.preprocess_defines->size() == 2);
303  BOOST_CHECK(co.preprocess_defines->at(0) == "DEFFOO" && co.preprocess_defines->at(1) == "DEFBAR");
304  BOOST_CHECK(co.preprocess_input_macros && *co.preprocess_input_macros == "inmfoo");
305  BOOST_CHECK(co.preprocess_output_macros && *co.preprocess_output_macros == "outmfoo");
306  BOOST_CHECK(co.resolution);
307  BOOST_CHECK(co.resolution->first == 800 && co.resolution->second == 600);
308  BOOST_CHECK(co.rng_seed && *co.rng_seed == 1234);
309  BOOST_CHECK(co.server && *co.server == "servfoo");
310  BOOST_CHECK(co.screenshot && co.screenshot_map_file && co.screenshot_output_file);
311  BOOST_CHECK(*co.screenshot_map_file == "mapfoo" && *co.screenshot_output_file == "outssfoo");
312  BOOST_CHECK(co.test && *co.test == "testfoo");
313  BOOST_CHECK(co.userconfig_dir && *co.userconfig_dir == "userconfigdirfoo");
314  BOOST_CHECK(co.userconfig_path);
315  BOOST_CHECK(co.userdata_dir && *co.userdata_dir == "userdatadirfoo");
316  BOOST_CHECK(co.userdata_path);
317  BOOST_CHECK(co.validcache);
318  BOOST_CHECK(co.version);
319  BOOST_CHECK(co.windowed);
320  BOOST_CHECK(co.with_replay);
321 }
322 
323 BOOST_AUTO_TEST_CASE (test_positional_options)
324 {
325  std::vector<std::string> args {
326  "wesnoth",
327  "datadirfoo"};
328 
329  commandline_options co(args);
330 
331  BOOST_CHECK(!co.campaign);
332  BOOST_CHECK(!co.campaign_difficulty);
333  BOOST_CHECK(!co.campaign_scenario);
334  BOOST_CHECK(!co.campaign_skip_story);
335  BOOST_CHECK(!co.clock);
336  BOOST_CHECK(co.data_dir && *co.data_dir == "datadirfoo");
337  BOOST_CHECK(!co.data_path);
338  BOOST_CHECK(!co.debug);
339 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
340  BOOST_CHECK(!co.debug_dot_domain);
341  BOOST_CHECK(!co.debug_dot_level);
342 #endif
343  BOOST_CHECK(!co.editor);
344  BOOST_CHECK(!co.fps);
345  BOOST_CHECK(!co.fullscreen);
346  BOOST_CHECK(!co.gunzip);
347  BOOST_CHECK(!co.gzip);
348  BOOST_CHECK(!co.help);
349  BOOST_CHECK(!co.load);
350  BOOST_CHECK(!co.log);
351  BOOST_CHECK(!co.logdomains);
352  BOOST_CHECK(!co.multiplayer);
353  BOOST_CHECK(!co.multiplayer_ai_config);
354  BOOST_CHECK(!co.multiplayer_algorithm);
355  BOOST_CHECK(!co.multiplayer_controller);
356  BOOST_CHECK(!co.multiplayer_era);
357  BOOST_CHECK(!co.multiplayer_exit_at_end);
358  BOOST_CHECK(!co.multiplayer_ignore_map_settings);
359  BOOST_CHECK(!co.multiplayer_label);
360  BOOST_CHECK(!co.multiplayer_parm);
361  BOOST_CHECK(!co.multiplayer_scenario);
362  BOOST_CHECK(!co.multiplayer_side);
363  BOOST_CHECK(!co.multiplayer_turns);
364  BOOST_CHECK(!co.max_fps);
365  BOOST_CHECK(!co.nocache);
366  BOOST_CHECK(!co.nodelay);
367  BOOST_CHECK(!co.nogui);
368  BOOST_CHECK(!co.nomusic);
369  BOOST_CHECK(!co.nosound);
370  BOOST_CHECK(!co.new_widgets);
371  BOOST_CHECK(!co.preprocess);
372  BOOST_CHECK(!co.preprocess_defines);
373  BOOST_CHECK(!co.preprocess_input_macros);
374  BOOST_CHECK(!co.preprocess_output_macros);
375  BOOST_CHECK(!co.preprocess_path);
376  BOOST_CHECK(!co.preprocess_target);
377  BOOST_CHECK(!co.resolution);
378  BOOST_CHECK(!co.rng_seed);
379  BOOST_CHECK(!co.server);
380  BOOST_CHECK(!co.screenshot);
381  BOOST_CHECK(!co.screenshot_map_file);
382  BOOST_CHECK(!co.screenshot_output_file);
383  BOOST_CHECK(!co.test);
384  BOOST_CHECK(!co.userconfig_dir);
385  BOOST_CHECK(!co.userconfig_path);
386  BOOST_CHECK(!co.userdata_dir);
387  BOOST_CHECK(!co.userdata_path);
388  BOOST_CHECK(!co.validcache);
389  BOOST_CHECK(!co.version);
390  BOOST_CHECK(!co.windowed);
391  BOOST_CHECK(!co.with_replay);
392 }
393 
394 BOOST_AUTO_TEST_SUITE_END()
bool nogui
True if –nogui was given on the command line. Disables GUI.
boost::optional< std::string > multiplayer_turns
Non-empty if –turns was given on the command line. Dependent on –multiplayer.
bool userdata_path
True if –userdata-path was given on the command line. Prints path to user data directory and exits...
boost::optional< std::string > multiplayer_scenario
Non-empty if –scenario was given on the command line. Dependent on –multiplayer.
bool multiplayer_ignore_map_settings
True if –ignore-map-settings was given at the command line. Do not use map settings.
boost::optional< std::string > gunzip
Non-empty if –gunzip was given on the command line. Uncompresses a .gz file and exits.
boost::optional< std::string > campaign_scenario
Non-empty if –campaign-scenario was given on the command line. Chooses starting scenario in the camp...
boost::optional< int > max_fps
Max FPS specified by –max-fps option.
boost::optional< unsigned int > rng_seed
RNG seed specified by –rng-seed option. Initializes RNG with given seed.
bool fps
True if –fps was given on the command line. Shows number of fps.
boost::optional< std::string > data_dir
Non-empty if –data-dir was given on the command line. Sets the config dir to the specified one...
boost::optional< std::string > multiplayer_era
Non-empty if –era was given on the command line. Dependent on –multiplayer.
boost::optional< std::vector< std::pair< unsigned int, std::string > > > multiplayer_side
Non-empty if –side was given on the command line. Vector of pairs (side number, faction id)...
boost::optional< std::string > multiplayer_label
Non-empty if –label was given on the command line. Dependent on –multiplayer.
boost::optional< std::string > load
Non-empty if –load was given on the command line. Savegame specified to load after start...
bool preprocess
True if –preprocess was given on the command line. Starts Wesnoth in preprocessor-only mode...
bool with_replay
True if –with-replay was given on the command line. Shows replay of the loaded file.
boost::optional< std::string > userconfig_dir
Non-empty if –userconfig-dir was given on the command line. Sets the user config dir to the specifie...
boost::optional< std::vector< std::pair< unsigned int, std::string > > > multiplayer_ai_config
Non-empty if –ai-config was given on the command line. Vector of pairs (side number, value). Dependent on –multiplayer.
bool nodelay
True if –nodelay was given on the command line.
boost::optional< std::string > logdomains
Non-empty if –logdomains was given on the command line. Prints possible logdomains filtered by given...
bool windowed
True if –windowed was given on the command line. Starts Wesnoth in windowed mode.
boost::optional< std::string > editor
Non-empty if –editor was given on the command line. Goes directly into editor. If string is longer t...
boost::optional< std::string > userdata_dir
Non-empty if –userdata-dir was given on the command line. Sets the user data dir to the specified on...
boost::optional< std::string > gzip
Non-empty if –gzip was given on the command line. Compresses a file to .gz and exits.
boost::optional< std::string > preprocess_output_macros
Non-empty if –preprocess-output-macros was given on the command line. Outputs all preprocessed macro...
boost::optional< std::string > test
Non-empty if –test was given on the command line. Goes directly into test mode, into a scenario...
bool multiplayer
True if –multiplayer was given on the command line. Goes directly into multiplayer mode...
bool clock
True if –clock was given on the command line. Enables.
bool userconfig_path
True if –userconfig-path was given on the command line. Prints path to user config directory and exi...
boost::optional< std::vector< std::pair< unsigned int, std::string > > > multiplayer_algorithm
Non-empty if –algorithm was given on the command line. Vector of pairs (side number, value). Dependent on –multiplayer.
boost::optional< std::vector< std::pair< int, std::string > > > log
Contains parsed arguments of –log-* (e.g.
boost::optional< int > campaign_difficulty
Non-empty if –campaign-difficulty was given on the command line. Numerical difficulty of the campaig...
bool nomusic
True if –nomusic was given on the command line. Disables music.
boost::optional< std::string > preprocess_target
Target (output) path that was given to the –preprocess option.
bool debug
True if –debug was given on the command line. Enables debug mode.
bool nocache
True if –nocache was given on the command line. Disables cache usage.
boost::optional< std::string > screenshot_map_file
Map file to make a screenshot of. First parameter given after –screenshot.
boost::optional< std::string > preprocess_path
Path to parse that was given to the –preprocess option.
bool new_widgets
True if –new-widgets was given on the command line. Hidden option to enable the new widget toolkit...
boost::optional< std::vector< std::tuple< unsigned int, std::string, std::string > > > multiplayer_parm
Non-empty if –parm was given on the command line. Vector of pairs (side number, parm name...
bool campaign_skip_story
True if –skip-story was given on the command line. Skips [story] and [message]s through the end of t...
bool data_path
True if –data-path was given on the command line. Prints path to data directory and exits...
bool screenshot
True if –screenshot was given on the command line. Starts Wesnoth in screenshot mode.
bool version
True if –version was given on the command line. Prints version and exits.
boost::optional< std::string > screenshot_output_file
Output file to put screenshot in. Second parameter given after –screenshot.
bool fullscreen
True if –fullscreen was given on the command line. Starts Wesnoth in fullscreen mode.
bool validcache
True if –validcache was given on the command line. Makes Wesnoth assume the cache is valid...
boost::optional< std::vector< std::string > > preprocess_defines
Defines that were given to the –preprocess option.
bool nosound
True if –nosound was given on the command line. Disables sound.
boost::optional< std::string > preprocess_input_macros
Non-empty if –preprocess-input-macros was given on the command line. Specifies a file that contains ...
boost::optional< std::pair< int, int > > resolution
Pair of AxB values specified after –resolution. Changes Wesnoth resolution.
bool multiplayer_exit_at_end
True if –exit-at-and was given on the command line. Dependent on –multiplayer.
boost::optional< std::string > campaign
Non-empty if –campaign was given on the command line. ID of the campaign we want to start...
BOOST_AUTO_TEST_CASE(test_empty_options)
boost::optional< std::vector< std::pair< unsigned int, std::string > > > multiplayer_controller
Non-empty if –controller was given on the command line. Vector of pairs (side number, controller). Dependent on –multiplayer.
bool help
True if –help was given on the command line. Prints help and exits.
boost::optional< std::string > server
Non-empty if –server was given on the command line. Connects Wesnoth to specified server...