The Battle for Wesnoth  1.19.0-dev
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
commandline_options Class Reference

#include <commandline_options.hpp>

Public Member Functions

 commandline_options (const std::vector< std::string > &args)
 
config to_config () const
 
bool any_validation_option () const
 True if the –validate or any of the –validate-* options are given. More...
 

Public Attributes

std::optional< std::string > campaign
 Non-empty if –campaign was given on the command line. More...
 
std::optional< int > campaign_difficulty
 Non-empty if –campaign-difficulty was given on the command line. More...
 
std::optional< std::string > campaign_scenario
 Non-empty if –campaign-scenario was given on the command line. More...
 
bool campaign_skip_story
 True if –skip-story was given on the command line. More...
 
bool clock
 True if –clock was given on the command line. More...
 
std::optional< std::string > core_id
 Non-empty if –core was given on the command line. More...
 
bool data_path
 True if –data-path was given on the command line. More...
 
std::optional< std::string > data_dir
 Non-empty if –data-dir was given on the command line. More...
 
bool debug
 True if –debug was given on the command line. More...
 
bool debug_lua
 True if –debug-lua was given in the commandline. More...
 
bool strict_lua
 True if –strict-lua was given in the commandline. More...
 
bool allow_insecure
 True if –allow-insecure was given in the commandline. More...
 
std::optional< std::string > editor
 Non-empty if –editor was given on the command line. More...
 
bool fps
 True if –fps was given on the command line. More...
 
bool fullscreen
 True if –fullscreen was given on the command line. More...
 
bool help
 True if –help was given on the command line. More...
 
std::optional< std::string > language
 Non-empty if –language was given on the command line. More...
 
std::optional< std::vector< std::pair< lg::severity, std::string > > > log
 Contains parsed arguments of –log-* (e.g. More...
 
std::optional< int > log_strict_level
 Non-empty if –log-strict was given. More...
 
std::optional< std::string > load
 Non-empty if –load was given on the command line. More...
 
std::optional< std::string > logdomains
 Non-empty if –logdomains was given on the command line. More...
 
bool log_precise_timestamps
 True if –log-precise was given on the command line. More...
 
bool multiplayer
 True if –multiplayer was given on the command line. More...
 
std::optional< std::vector< std::pair< unsigned int, std::string > > > multiplayer_ai_config
 Non-empty if –ai-config was given on the command line. More...
 
std::optional< std::vector< std::pair< unsigned int, std::string > > > multiplayer_algorithm
 Non-empty if –algorithm was given on the command line. More...
 
std::optional< std::vector< std::pair< unsigned int, std::string > > > multiplayer_controller
 Non-empty if –controller was given on the command line. More...
 
std::optional< std::string > multiplayer_era
 Non-empty if –era was given on the command line. More...
 
bool multiplayer_exit_at_end
 True if –exit-at-and was given on the command line. More...
 
bool multiplayer_ignore_map_settings
 True if –ignore-map-settings was given at the command line. More...
 
std::optional< std::string > multiplayer_label
 Non-empty if –label was given on the command line. More...
 
std::optional< std::vector< std::tuple< unsigned int, std::string, std::string > > > multiplayer_parm
 Non-empty if –parm was given on the command line. More...
 
std::optional< unsigned int > multiplayer_repeat
 Repeats specified by –multiplayer-repeat option. More...
 
std::optional< std::string > multiplayer_scenario
 Non-empty if –scenario was given on the command line. More...
 
std::optional< std::vector< std::pair< unsigned int, std::string > > > multiplayer_side
 Non-empty if –side was given on the command line. More...
 
std::optional< std::string > multiplayer_turns
 Non-empty if –turns was given on the command line. More...
 
std::optional< int > max_fps
 Max FPS specified by –max-fps option. More...
 
bool noaddons
 True if –noaddons was given on the command line. More...
 
bool nocache
 True if –nocache was given on the command line. More...
 
bool nodelay
 True if –nodelay was given on the command line. More...
 
bool nogui
 True if –nogui was given on the command line. More...
 
bool nobanner
 True if –nobanner was given on the command line. More...
 
bool nomusic
 True if –nomusic was given on the command line. More...
 
bool nosound
 True if –nosound was given on the command line. More...
 
bool new_widgets
 True if –new-widgets was given on the command line. More...
 
bool preprocess
 True if –preprocess was given on the command line. More...
 
std::optional< std::vector< std::string > > preprocess_defines
 Defines that were given to the –preprocess option. More...
 
std::optional< std::string > preprocess_input_macros
 Non-empty if –preprocess-input-macros was given on the command line. More...
 
std::optional< std::string > preprocess_output_macros
 Non-empty if –preprocess-output-macros was given on the command line. More...
 
std::optional< std::string > preprocess_path
 Path to parse that was given to the –preprocess option. More...
 
std::optional< std::string > preprocess_target
 Target (output) path that was given to the –preprocess option. More...
 
std::optional< std::pair< int, int > > resolution
 Pair of AxB values specified after –resolution. More...
 
std::optional< unsigned int > rng_seed
 RNG seed specified by –rng-seed option. More...
 
std::optional< std::string > server
 Non-empty if –server was given on the command line. More...
 
std::optional< std::string > username
 Non-empty if –username was given on the command line. More...
 
std::optional< std::string > password
 Non-empty if –password was given on the command line. More...
 
std::optional< std::string > render_image
 Image path to render. More...
 
std::optional< std::string > render_image_dst
 Output file to put rendered image path in. More...
 
bool screenshot
 True if –screenshot was given on the command line. More...
 
std::optional< std::string > screenshot_map_file
 Map file to make a screenshot of. More...
 
std::optional< std::string > screenshot_output_file
 Output file to put screenshot in. More...
 
std::optional< std::string > script_file
 File to load lua script from. More...
 
std::optional< std::string > plugin_file
 File to load a lua plugin (similar to a script) from. More...
 
bool script_unsafe_mode
 Whether to load the "package" package for the scripting environment. More...
 
bool strict_validation
 True if –strict-validation was given on the command line. More...
 
std::optional< std::string > test
 Non-empty if –test was given on the command line. More...
 
std::vector< std::string > unit_test
 Non-empty if –unit was given on the command line. More...
 
bool headless_unit_test
 True if –unit is used and –showgui is not present. More...
 
bool noreplaycheck
 True if –noreplaycheck was given on the command line. More...
 
bool mptest
 True if –mp-test was given on the command line. More...
 
bool usercache_path
 True if –usercache-path was given on the command line. More...
 
std::optional< std::string > usercache_dir
 Non-empty if –usercache-dir was given on the command line. More...
 
bool userconfig_path
 True if –userconfig-path was given on the command line. More...
 
std::optional< std::string > userconfig_dir
 Non-empty if –userconfig-dir was given on the command line. More...
 
bool userdata_path
 True if –userdata-path was given on the command line. More...
 
std::optional< std::string > userdata_dir
 Non-empty if –userdata-dir was given on the command line. More...
 
bool validcache
 True if –validcache was given on the command line. More...
 
bool validate_core
 True if –validate-core was given on the command line. More...
 
std::optional< std::string > validate_addon
 Non-empty if –validate-addon was given on the command line. More...
 
std::optional< std::string > validate_schema
 Non-empty if –validate-schema was given on the command line. More...
 
std::optional< std::string > validate_wml
 Non-empty if –validate was given on the command line. More...
 
std::optional< std::string > validate_with
 Non-empty if –use-schema was given on the command line. More...
 
std::optional< std::string > output_file
 Output filename for WML diff or preprocessing. More...
 
bool do_diff
 
bool do_patch
 
std::string diff_left
 Files for diffing or patching. More...
 
std::string diff_right
 
bool version
 True if –version was given on the command line. More...
 
bool simple_version
 True if –simple-version was given on the command line. More...
 
bool report
 True if –report was given on the command line. More...
 
bool windowed
 True if –windowed was given on the command line. More...
 
bool with_replay
 True if –with-replay was given on the command line. More...
 
std::optional< unsigned int > translation_percent
 Non-empty if –all-translations or –translations-over is given on the command line. More...
 

Private Member Functions

void parse_log_domains_ (const std::string &domains_string, const lg::severity severity)
 
void parse_log_strictness (const std::string &severity)
 
void parse_resolution_ (const std::string &resolution_string)
 
std::vector< std::pair< unsigned int, std::string > > parse_to_uint_string_tuples_ (const std::vector< std::string > &strings, char separator=':')
 A helper function splitting vector of strings of format unsigned int:string to vector of tuples (unsigned int,string) More...
 
std::vector< std::tuple< unsigned int, std::string, std::string > > parse_to_uint_string_string_tuples_ (const std::vector< std::string > &strings, char separator=':')
 A helper function splitting vector of strings of format unsigned int:string:string to vector of tuples (unsigned int,string,string) More...
 

Private Attributes

std::vector< std::string > args_
 
std::string args0_
 
boost::program_options::options_description all_
 
boost::program_options::options_description visible_
 
boost::program_options::options_description hidden_
 

Friends

std::ostream & operator<< (std::ostream &os, const commandline_options &cmdline_opts)
 To be used for printing help to the commandline. More...
 

Detailed Description

Definition at line 43 of file commandline_options.hpp.

Constructor & Destructor Documentation

◆ commandline_options()

commandline_options::commandline_options ( const std::vector< std::string > &  args)

Definition at line 66 of file commandline_options.cpp.

References all_, allow_insecure, args_, campaign, campaign_difficulty, campaign_scenario, campaign_skip_story, clock, core_id, data_dir, data_path, debug, lg::debug(), debug_lua, diff_left, diff_right, do_diff, do_patch, lg::err(), fps, fullscreen, lg::logger::get_severity(), headless_unit_test, hidden_, IMPLY_TERMINAL, lg::info(), language, lg::LG_NONE, load, log_precise_timestamps, logdomains, max_fps, mptest, multiplayer, multiplayer_ai_config, multiplayer_algorithm, multiplayer_controller, multiplayer_era, multiplayer_exit_at_end, multiplayer_ignore_map_settings, multiplayer_label, multiplayer_parm, multiplayer_repeat, multiplayer_scenario, multiplayer_side, multiplayer_turns, new_widgets, noaddons, nobanner, nocache, nodelay, nogui, nomusic, noreplaycheck, nosound, output_file, parse_log_domains_(), parse_log_strictness(), parse_resolution_(), parse_to_uint_string_string_tuples_(), parse_to_uint_string_tuples_(), password, plugin_file, preprocess, preprocess_defines, preprocess_input_macros, preprocess_output_macros, preprocess_path, preprocess_target, render_image, render_image_dst, report, rng_seed, screenshot, screenshot_map_file, screenshot_output_file, script_file, script_unsafe_mode, server, simple_version, utils::split(), strict_lua, strict_validation, test, translation_percent, unit_test, usercache_dir, usercache_path, userconfig_dir, userconfig_path, userdata_dir, userdata_path, username, validate_addon, validate_core, validate_schema, validate_with, validate_wml, validcache, version, visible_, lg::warn(), windowed, and with_replay.

Member Function Documentation

◆ any_validation_option()

bool commandline_options::any_validation_option ( ) const

True if the –validate or any of the –validate-* options are given.

Definition at line 665 of file commandline_options.cpp.

References validate_addon, validate_core, validate_schema, validate_with, and validate_wml.

Referenced by game_config_manager::game_config_manager().

◆ parse_log_domains_()

void commandline_options::parse_log_domains_ ( const std::string &  domains_string,
const lg::severity  severity 
)
private

Definition at line 549 of file commandline_options.cpp.

References lg::domains, log, and utils::split().

Referenced by commandline_options().

◆ parse_log_strictness()

void commandline_options::parse_log_strictness ( const std::string &  severity)
private

◆ parse_resolution_()

void commandline_options::parse_resolution_ ( const std::string &  resolution_string)
private

Definition at line 573 of file commandline_options.cpp.

References resolution, and utils::split().

Referenced by commandline_options().

◆ parse_to_uint_string_string_tuples_()

std::vector< std::tuple< unsigned int, std::string, std::string > > commandline_options::parse_to_uint_string_string_tuples_ ( const std::vector< std::string > &  strings,
char  separator = ':' 
)
private

A helper function splitting vector of strings of format unsigned int:string:string to vector of tuples (unsigned int,string,string)

Definition at line 618 of file commandline_options.cpp.

References s, and utils::split().

Referenced by commandline_options().

◆ parse_to_uint_string_tuples_()

std::vector< std::pair< unsigned int, std::string > > commandline_options::parse_to_uint_string_tuples_ ( const std::vector< std::string > &  strings,
char  separator = ':' 
)
private

A helper function splitting vector of strings of format unsigned int:string to vector of tuples (unsigned int,string)

Definition at line 592 of file commandline_options.cpp.

References s, and utils::split().

Referenced by commandline_options().

◆ to_config()

config commandline_options::to_config ( ) const

Definition at line 651 of file commandline_options.cpp.

References password, server, and username.

Referenced by do_gameloop().

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const commandline_options cmdline_opts 
)
friend

To be used for printing help to the commandline.

Definition at line 644 of file commandline_options.cpp.

Member Data Documentation

◆ all_

boost::program_options::options_description commandline_options::all_
private

Definition at line 258 of file commandline_options.hpp.

Referenced by commandline_options().

◆ allow_insecure

bool commandline_options::allow_insecure

True if –allow-insecure was given in the commandline.

Allows sending a plaintext password over an unencrypted connection. Should only ever be used for local testing.

Definition at line 83 of file commandline_options.hpp.

Referenced by commandline_options(), and process_command_args().

◆ args0_

std::string commandline_options::args0_
private

Definition at line 257 of file commandline_options.hpp.

◆ args_

std::vector<std::string> commandline_options::args_
private

Definition at line 256 of file commandline_options.hpp.

Referenced by commandline_options().

◆ campaign

std::optional<std::string> commandline_options::campaign

Non-empty if –campaign was given on the command line.

ID of the campaign we want to start.

Definition at line 57 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and game_launcher::game_launcher().

◆ campaign_difficulty

std::optional<int> commandline_options::campaign_difficulty

Non-empty if –campaign-difficulty was given on the command line.

Numerical difficulty of the campaign to be played. Dependent on –campaign.

Definition at line 59 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and game_launcher::game_launcher().

◆ campaign_scenario

std::optional<std::string> commandline_options::campaign_scenario

Non-empty if –campaign-scenario was given on the command line.

Chooses starting scenario in the campaign to be played. Dependent on –campaign.

Definition at line 61 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and game_launcher::game_launcher().

◆ campaign_skip_story

bool commandline_options::campaign_skip_story

True if –skip-story was given on the command line.

Skips [story] and [message]s through the end of the "start" event. Dependent on –campaign.

Definition at line 63 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and game_launcher::game_launcher().

◆ clock

bool commandline_options::clock

True if –clock was given on the command line.

Enables

Definition at line 65 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and game_launcher::game_launcher().

◆ core_id

std::optional<std::string> commandline_options::core_id

Non-empty if –core was given on the command line.

Chooses the core to be loaded.

Definition at line 67 of file commandline_options.hpp.

Referenced by commandline_options(), and game_launcher::game_launcher().

◆ data_dir

std::optional<std::string> commandline_options::data_dir

Non-empty if –data-dir was given on the command line.

Sets the config dir to the specified one.

Definition at line 71 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and process_command_args().

◆ data_path

bool commandline_options::data_path

True if –data-path was given on the command line.

Prints path to data directory and exits.

Definition at line 69 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and process_command_args().

◆ debug

bool commandline_options::debug

True if –debug was given on the command line.

Enables debug mode.

Definition at line 73 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and game_launcher::game_launcher().

◆ debug_lua

bool commandline_options::debug_lua

True if –debug-lua was given in the commandline.

Enables some Lua debugging mechanisms.

Definition at line 75 of file commandline_options.hpp.

Referenced by commandline_options(), and process_command_args().

◆ diff_left

std::string commandline_options::diff_left

Files for diffing or patching.

Definition at line 235 of file commandline_options.hpp.

Referenced by commandline_options(), and process_command_args().

◆ diff_right

std::string commandline_options::diff_right

Definition at line 235 of file commandline_options.hpp.

Referenced by commandline_options(), and process_command_args().

◆ do_diff

bool commandline_options::do_diff

Definition at line 233 of file commandline_options.hpp.

Referenced by commandline_options(), and process_command_args().

◆ do_patch

bool commandline_options::do_patch

Definition at line 233 of file commandline_options.hpp.

Referenced by commandline_options(), and process_command_args().

◆ editor

std::optional<std::string> commandline_options::editor

Non-empty if –editor was given on the command line.

Goes directly into editor. If string is longer than 0, it contains path to the file to edit.

Definition at line 91 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), game_launcher::game_launcher(), and game_config_manager::init_game_config().

◆ fps

bool commandline_options::fps

True if –fps was given on the command line.

Shows number of fps.

Definition at line 93 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and game_launcher::game_launcher().

◆ fullscreen

bool commandline_options::fullscreen

True if –fullscreen was given on the command line.

Starts Wesnoth in fullscreen mode.

Definition at line 95 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and game_launcher::game_launcher().

◆ headless_unit_test

bool commandline_options::headless_unit_test

True if –unit is used and –showgui is not present.

Definition at line 202 of file commandline_options.hpp.

Referenced by game_launcher::change_language(), commandline_options(), game_launcher::game_launcher(), and game_launcher::init_video().

◆ help

bool commandline_options::help

True if –help was given on the command line.

Prints help and exits.

Definition at line 97 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), and process_command_args().

◆ hidden_

boost::program_options::options_description commandline_options::hidden_
private

Definition at line 260 of file commandline_options.hpp.

Referenced by commandline_options().

◆ language

std::optional<std::string> commandline_options::language

Non-empty if –language was given on the command line.

Sets the language for this session.

Definition at line 99 of file commandline_options.hpp.

Referenced by commandline_options(), and game_launcher::init_language().

◆ load

std::optional<std::string> commandline_options::load

Non-empty if –load was given on the command line.

Savegame specified to load after start.

Definition at line 108 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and game_launcher::game_launcher().

◆ log

std::optional<std::vector<std::pair<lg::severity, std::string> > > commandline_options::log

Contains parsed arguments of –log-* (e.g.

–log-debug). Vector of pairs (severity, log domain).

Definition at line 104 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), parse_log_domains_(), and process_command_args().

◆ log_precise_timestamps

bool commandline_options::log_precise_timestamps

True if –log-precise was given on the command line.

Shows timestamps in log with more precision.

Definition at line 112 of file commandline_options.hpp.

Referenced by commandline_options(), and process_command_args().

◆ log_strict_level

std::optional<int> commandline_options::log_strict_level

Non-empty if –log-strict was given.

Definition at line 106 of file commandline_options.hpp.

◆ logdomains

std::optional<std::string> commandline_options::logdomains

Non-empty if –logdomains was given on the command line.

Prints possible logdomains filtered by given string and exits.

Definition at line 110 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and process_command_args().

◆ max_fps

std::optional<int> commandline_options::max_fps

Max FPS specified by –max-fps option.

Definition at line 140 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and game_launcher::game_launcher().

◆ mptest

bool commandline_options::mptest

◆ multiplayer

bool commandline_options::multiplayer

True if –multiplayer was given on the command line.

Goes directly into multiplayer mode.

Definition at line 114 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), game_config_manager::init_game_config(), game_launcher::init_video(), and game_launcher::play_multiplayer_commandline().

◆ multiplayer_ai_config

std::optional<std::vector<std::pair<unsigned int, std::string> > > commandline_options::multiplayer_ai_config

Non-empty if –ai-config was given on the command line.

Vector of pairs (side number, value). Dependent on –multiplayer.

Definition at line 116 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and ng::connect_engine::start_game_commandline().

◆ multiplayer_algorithm

std::optional<std::vector<std::pair<unsigned int, std::string> > > commandline_options::multiplayer_algorithm

Non-empty if –algorithm was given on the command line.

Vector of pairs (side number, value). Dependent on –multiplayer.

Definition at line 118 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and ng::connect_engine::start_game_commandline().

◆ multiplayer_controller

std::optional<std::vector<std::pair<unsigned int, std::string> > > commandline_options::multiplayer_controller

Non-empty if –controller was given on the command line.

Vector of pairs (side number, controller). Dependent on –multiplayer.

Definition at line 120 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and ng::connect_engine::start_game_commandline().

◆ multiplayer_era

std::optional<std::string> commandline_options::multiplayer_era

Non-empty if –era was given on the command line.

Dependent on –multiplayer.

Definition at line 122 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and mp::start_local_game_commandline().

◆ multiplayer_exit_at_end

bool commandline_options::multiplayer_exit_at_end

True if –exit-at-and was given on the command line.

Dependent on –multiplayer.

Definition at line 124 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), and commandline_options().

◆ multiplayer_ignore_map_settings

bool commandline_options::multiplayer_ignore_map_settings

True if –ignore-map-settings was given at the command line.

Do not use map settings.

Definition at line 126 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), ng::connect_engine::start_game_commandline(), and mp::start_local_game_commandline().

◆ multiplayer_label

std::optional<std::string> commandline_options::multiplayer_label

Non-empty if –label was given on the command line.

Dependent on –multiplayer.

Definition at line 128 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and mp::start_local_game_commandline().

◆ multiplayer_parm

std::optional<std::vector<std::tuple<unsigned int, std::string, std::string> > > commandline_options::multiplayer_parm

Non-empty if –parm was given on the command line.

Vector of pairs (side number, parm name, parm value). Dependent on –multiplayer.

Definition at line 130 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and ng::connect_engine::start_game_commandline().

◆ multiplayer_repeat

std::optional<unsigned int> commandline_options::multiplayer_repeat

Repeats specified by –multiplayer-repeat option.

Repeats a multiplayer game after it is finished. Dependent on –multiplayer.

Definition at line 132 of file commandline_options.hpp.

Referenced by commandline_options(), and mp::start_local_game_commandline().

◆ multiplayer_scenario

std::optional<std::string> commandline_options::multiplayer_scenario

Non-empty if –scenario was given on the command line.

Dependent on –multiplayer.

Definition at line 134 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and mp::start_local_game_commandline().

◆ multiplayer_side

std::optional<std::vector<std::pair<unsigned int, std::string> > > commandline_options::multiplayer_side

Non-empty if –side was given on the command line.

Vector of pairs (side number, faction id). Dependent on –multiplayer.

Definition at line 136 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and ng::connect_engine::start_game_commandline().

◆ multiplayer_turns

std::optional<std::string> commandline_options::multiplayer_turns

Non-empty if –turns was given on the command line.

Dependent on –multiplayer.

Definition at line 138 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and ng::connect_engine::start_game_commandline().

◆ new_widgets

bool commandline_options::new_widgets

True if –new-widgets was given on the command line.

Hidden option to enable the new widget toolkit.

Definition at line 156 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and game_launcher::game_launcher().

◆ noaddons

bool commandline_options::noaddons

True if –noaddons was given on the command line.

Disables the loading of all add-ons.

Definition at line 142 of file commandline_options.hpp.

Referenced by commandline_options(), do_gameloop(), and game_config_manager::load_game_config().

◆ nobanner

bool commandline_options::nobanner

True if –nobanner was given on the command line.

Disables startup banner.

Definition at line 150 of file commandline_options.hpp.

Referenced by commandline_options(), game_launcher::game_launcher(), game_launcher::init_lua_script(), and process_command_args().

◆ nocache

bool commandline_options::nocache

True if –nocache was given on the command line.

Disables cache usage.

Definition at line 144 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and game_config_manager::game_config_manager().

◆ nodelay

bool commandline_options::nodelay

True if –nodelay was given on the command line.

Definition at line 146 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and game_launcher::game_launcher().

◆ nogui

bool commandline_options::nogui

True if –nogui was given on the command line.

Disables GUI.

Definition at line 148 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), game_launcher::change_language(), commandline_options(), game_launcher::game_launcher(), and game_launcher::init_video().

◆ nomusic

bool commandline_options::nomusic

True if –nomusic was given on the command line.

Disables music.

Definition at line 152 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and game_launcher::game_launcher().

◆ noreplaycheck

bool commandline_options::noreplaycheck

True if –noreplaycheck was given on the command line.

Dependent on –unit.

Definition at line 204 of file commandline_options.hpp.

Referenced by commandline_options(), and game_launcher::single_unit_test().

◆ nosound

bool commandline_options::nosound

True if –nosound was given on the command line.

Disables sound.

Definition at line 154 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and game_launcher::game_launcher().

◆ output_file

std::optional<std::string> commandline_options::output_file

Output filename for WML diff or preprocessing.

Definition at line 232 of file commandline_options.hpp.

Referenced by commandline_options(), and process_command_args().

◆ password

std::optional<std::string> commandline_options::password

Non-empty if –password was given on the command line.

Forces Wesnoth to use this network password.

Definition at line 178 of file commandline_options.hpp.

Referenced by commandline_options(), game_launcher::game_launcher(), and to_config().

◆ plugin_file

std::optional<std::string> commandline_options::plugin_file

File to load a lua plugin (similar to a script) from.

Experimental / may replace script.

Definition at line 192 of file commandline_options.hpp.

Referenced by commandline_options(), game_launcher::init_lua_script(), and game_launcher::init_video().

◆ preprocess

bool commandline_options::preprocess

True if –preprocess was given on the command line.

Starts Wesnoth in preprocessor-only mode.

Definition at line 158 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and process_command_args().

◆ preprocess_defines

std::optional<std::vector<std::string> > commandline_options::preprocess_defines

Defines that were given to the –preprocess option.

Definition at line 160 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), handle_preprocess_command(), and process_command_args().

◆ preprocess_input_macros

std::optional<std::string> commandline_options::preprocess_input_macros

Non-empty if –preprocess-input-macros was given on the command line.

Specifies a file that contains [preproc_define]s to be included before preprocessing. Dependent on –preprocess.

Definition at line 162 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), handle_preprocess_command(), and process_command_args().

◆ preprocess_output_macros

std::optional<std::string> commandline_options::preprocess_output_macros

Non-empty if –preprocess-output-macros was given on the command line.

Outputs all preprocessed macros to the specified file. Dependent on –preprocess.

Definition at line 164 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and handle_preprocess_command().

◆ preprocess_path

std::optional<std::string> commandline_options::preprocess_path

Path to parse that was given to the –preprocess option.

Definition at line 166 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), handle_preprocess_command(), and process_command_args().

◆ preprocess_target

std::optional<std::string> commandline_options::preprocess_target

Target (output) path that was given to the –preprocess option.

Definition at line 168 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and handle_preprocess_command().

◆ render_image

std::optional<std::string> commandline_options::render_image

Image path to render.

First parameter after –render-image

Definition at line 180 of file commandline_options.hpp.

Referenced by commandline_options(), game_launcher::init_video(), game_launcher::play_render_image_mode(), and process_command_args().

◆ render_image_dst

std::optional<std::string> commandline_options::render_image_dst

Output file to put rendered image path in.

Optional second parameter after –render-image

Definition at line 182 of file commandline_options.hpp.

Referenced by commandline_options(), and game_launcher::play_render_image_mode().

◆ report

bool commandline_options::report

True if –report was given on the command line.

Prints a bug report-style info dump and exits.

Definition at line 241 of file commandline_options.hpp.

Referenced by commandline_options(), and process_command_args().

◆ resolution

std::optional<std::pair<int,int> > commandline_options::resolution

Pair of AxB values specified after –resolution.

Changes Wesnoth resolution.

Definition at line 170 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), game_launcher::game_launcher(), and parse_resolution_().

◆ rng_seed

std::optional<unsigned int> commandline_options::rng_seed

RNG seed specified by –rng-seed option.

Initializes RNG with given seed.

Definition at line 172 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and process_command_args().

◆ screenshot

bool commandline_options::screenshot

True if –screenshot was given on the command line.

Starts Wesnoth in screenshot mode.

Definition at line 184 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), game_launcher::game_launcher(), game_launcher::init_video(), and game_launcher::play_screenshot_mode().

◆ screenshot_map_file

std::optional<std::string> commandline_options::screenshot_map_file

Map file to make a screenshot of.

First parameter given after –screenshot.

Definition at line 186 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and game_launcher::game_launcher().

◆ screenshot_output_file

std::optional<std::string> commandline_options::screenshot_output_file

Output file to put screenshot in.

Second parameter given after –screenshot.

Definition at line 188 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and game_launcher::game_launcher().

◆ script_file

std::optional<std::string> commandline_options::script_file

File to load lua script from.

Definition at line 190 of file commandline_options.hpp.

Referenced by commandline_options(), and game_launcher::init_lua_script().

◆ script_unsafe_mode

bool commandline_options::script_unsafe_mode

Whether to load the "package" package for the scripting environment.

(This allows to load arbitrary lua packages, and gives untrusted lua the same permissions as wesnoth executable)

Definition at line 194 of file commandline_options.hpp.

Referenced by commandline_options(), and game_launcher::init_lua_script().

◆ server

std::optional<std::string> commandline_options::server

Non-empty if –server was given on the command line.

Connects Wesnoth to specified server. If no server was specified afterwards, contains an empty string.

Definition at line 174 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), game_launcher::game_launcher(), and to_config().

◆ simple_version

bool commandline_options::simple_version

True if –simple-version was given on the command line.

Prints version and nothing else then exits.

Definition at line 239 of file commandline_options.hpp.

Referenced by commandline_options(), and process_command_args().

◆ strict_lua

bool commandline_options::strict_lua

True if –strict-lua was given in the commandline.

Disallows use of deprecated APIs.

Definition at line 77 of file commandline_options.hpp.

Referenced by commandline_options(), and process_command_args().

◆ strict_validation

bool commandline_options::strict_validation

True if –strict-validation was given on the command line.

Makes Wesnoth trust validation errors as fatal WML errors and create WML exception, if so.

Definition at line 196 of file commandline_options.hpp.

Referenced by commandline_options(), and process_command_args().

◆ test

std::optional<std::string> commandline_options::test

Non-empty if –test was given on the command line.

Goes directly into test mode, into a scenario, if specified.

Definition at line 198 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), game_launcher::game_launcher(), game_config_manager::init_game_config(), and game_launcher::play_test().

◆ translation_percent

std::optional<unsigned int> commandline_options::translation_percent

Non-empty if –all-translations or –translations-over is given on the command line.

Definition at line 247 of file commandline_options.hpp.

Referenced by commandline_options(), and game_launcher::game_launcher().

◆ unit_test

std::vector<std::string> commandline_options::unit_test

Non-empty if –unit was given on the command line.

Goes directly into unit test mode, into a scenario, if specified.

Definition at line 200 of file commandline_options.hpp.

Referenced by commandline_options(), do_gameloop(), game_launcher::game_launcher(), and game_launcher::unit_test().

◆ usercache_dir

std::optional<std::string> commandline_options::usercache_dir

Non-empty if –usercache-dir was given on the command line.

Sets the cache dir to the specified one.

Definition at line 210 of file commandline_options.hpp.

Referenced by commandline_options(), and process_command_args().

◆ usercache_path

bool commandline_options::usercache_path

True if –usercache-path was given on the command line.

Prints path to cache directory and exits.

Definition at line 208 of file commandline_options.hpp.

Referenced by commandline_options(), and process_command_args().

◆ userconfig_dir

std::optional<std::string> commandline_options::userconfig_dir

Non-empty if –userconfig-dir was given on the command line.

Sets the user config dir to the specified one.

Definition at line 214 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and process_command_args().

◆ userconfig_path

bool commandline_options::userconfig_path

True if –userconfig-path was given on the command line.

Prints path to user config directory and exits.

Definition at line 212 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and process_command_args().

◆ userdata_dir

std::optional<std::string> commandline_options::userdata_dir

Non-empty if –userdata-dir was given on the command line.

Sets the user data dir to the specified one.

Definition at line 218 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and process_command_args().

◆ userdata_path

bool commandline_options::userdata_path

True if –userdata-path was given on the command line.

Prints path to user data directory and exits.

Definition at line 216 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and process_command_args().

◆ username

std::optional<std::string> commandline_options::username

Non-empty if –username was given on the command line.

Forces Wesnoth to use this network username.

Definition at line 176 of file commandline_options.hpp.

Referenced by commandline_options(), game_launcher::game_launcher(), and to_config().

◆ validate_addon

std::optional<std::string> commandline_options::validate_addon

Non-empty if –validate-addon was given on the command line.

Makes Wesnoth validate an addon's WML.

Definition at line 224 of file commandline_options.hpp.

Referenced by any_validation_option(), commandline_options(), and game_config_manager::load_addons_cfg().

◆ validate_core

bool commandline_options::validate_core

True if –validate-core was given on the command line.

Makes Wesnoth validate the core WML.

Definition at line 222 of file commandline_options.hpp.

Referenced by any_validation_option(), commandline_options(), and game_config_manager::load_game_config().

◆ validate_schema

std::optional<std::string> commandline_options::validate_schema

Non-empty if –validate-schema was given on the command line.

Makes Wesnoth validate a WML schema.

Definition at line 226 of file commandline_options.hpp.

Referenced by any_validation_option(), commandline_options(), and process_command_args().

◆ validate_with

std::optional<std::string> commandline_options::validate_with

Non-empty if –use-schema was given on the command line.

Specifies the schema for use with –validate.

Definition at line 230 of file commandline_options.hpp.

Referenced by any_validation_option(), commandline_options(), and process_command_args().

◆ validate_wml

std::optional<std::string> commandline_options::validate_wml

Non-empty if –validate was given on the command line.

Makes Wesnoth validate a WML file against a schema.

Definition at line 228 of file commandline_options.hpp.

Referenced by any_validation_option(), commandline_options(), and process_command_args().

◆ validcache

bool commandline_options::validcache

True if –validcache was given on the command line.

Makes Wesnoth assume the cache is valid.

Definition at line 220 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and game_config_manager::game_config_manager().

◆ version

bool commandline_options::version

True if –version was given on the command line.

Prints version and exits.

Definition at line 237 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and process_command_args().

◆ visible_

boost::program_options::options_description commandline_options::visible_
private

Definition at line 259 of file commandline_options.hpp.

Referenced by commandline_options().

◆ windowed

bool commandline_options::windowed

True if –windowed was given on the command line.

Starts Wesnoth in windowed mode.

Definition at line 243 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and game_launcher::game_launcher().

◆ with_replay

bool commandline_options::with_replay

True if –with-replay was given on the command line.

Shows replay of the loaded file.

Definition at line 245 of file commandline_options.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), commandline_options(), and game_launcher::game_launcher().


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