Skip to content

Commit

Permalink
remove duplicate cmd options
Browse files Browse the repository at this point in the history
The motivation is to have less path optins in the documentation

This Removes:
 - path
 - config-dir
 - config-path

Remaining path options are:
- data-path (same as path)
- userconfig-dir
- userconfig-path
- userdata-path (same as config-path)
- userdata-dir (same as config-dir)
  • Loading branch information
sevu committed Dec 14, 2018
1 parent 571da30 commit 23426de
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 34 deletions.
11 changes: 0 additions & 11 deletions doc/man/wesnoth.6
Expand Up @@ -79,14 +79,6 @@ event.
.B --clock
Adds the option to show a clock for testing the drawing timer.
.TP
.BI --config-dir \ name
Deprecated, use
.BR --userdata-dir .
.TP
.B --config-path
Deprecated, use
.BR --userdata-path .
.TP
.BI --core \ id_core
overrides the loaded core with the one whose id is specified.
.TP
Expand Down Expand Up @@ -232,9 +224,6 @@ uses
.I password
when connecting to a server, ignoring other preferences. Unsafe.
.TP
.B --path
prints the name of the game data directory and exits.
.TP
.BI --plugin \ script
(experimental) load a
.I script
Expand Down
10 changes: 0 additions & 10 deletions src/commandline_options.cpp
Expand Up @@ -107,7 +107,6 @@ commandline_options::commandline_options (const std::vector<std::string>& args)
nomusic(false),
nosound(false),
new_widgets(false),
path(false),
preprocess(false),
preprocess_defines(),
preprocess_input_macros(),
Expand Down Expand Up @@ -152,8 +151,6 @@ commandline_options::commandline_options (const std::vector<std::string>& args)
("bunzip2", po::value<std::string>(), "decompresses a file (<arg>.bz2) in bzip2 format and stores it without the .bz2 suffix. <arg>.bz2 will be removed.")
("bzip2", po::value<std::string>(), "compresses a file (<arg>) in bzip2 format, stores it as <arg>.bz2 and removes <arg>.")
("clock", "Adds the option to show a clock for testing the drawing timer.")
("config-dir", po::value<std::string>(), "sets the path of the userdata directory to $HOME/<arg> or My Documents\\My Games\\<arg> for Windows. You can specify also an absolute path outside the $HOME or My Documents\\My Games directory. DEPRECATED: use userdata-path and userconfig-path instead.")
("config-path", "prints the path of the userdata directory and exits. DEPRECATED: use userdata-path and userconfig-path instead.")
("core", po::value<std::string>(), "overrides the loaded core with the one whose id is specified.")
("data-dir", po::value<std::string>(), "overrides the data directory with the one specified.")
("data-path", "prints the path of the data directory and exits.")
Expand All @@ -175,7 +172,6 @@ commandline_options::commandline_options (const std::vector<std::string>& args)
("nomusic", "runs the game without music.")
("nosound", "runs the game without sounds and music.")
("password", po::value<std::string>(), "uses <password> when connecting to a server, ignoring other preferences.")
("path", "prints the path to the data directory and exits.")
("plugin", po::value<std::string>(), "(experimental) load a script which defines a wesnoth plugin. similar to --script below, but lua file should return a function which will be run as a coroutine and periodically woken up with updates.")
("render-image", po::value<two_strings>()->multitoken(), "takes two arguments: <image> <output>. Like screenshot, but instead of a map, takes a valid wesnoth 'image path string' with image path functions, and writes it to a .png file."
#ifdef _WIN32
Expand Down Expand Up @@ -320,10 +316,6 @@ commandline_options::commandline_options (const std::vector<std::string>& args)
clock = true;
if (vm.count("core"))
core_id = vm["core"].as<std::string>();
if (vm.count("config-dir"))
userdata_dir = vm["config-dir"].as<std::string>(); //TODO: complain and remove
if (vm.count("config-path"))
userdata_path = true; //TODO: complain and remove
if (vm.count("controller"))
multiplayer_controller = parse_to_uint_string_tuples_(vm["controller"].as<std::vector<std::string>>());
if (vm.count("data-dir"))
Expand Down Expand Up @@ -408,8 +400,6 @@ commandline_options::commandline_options (const std::vector<std::string>& args)
nogui = true;
if (vm.count("parm"))
multiplayer_parm = parse_to_uint_string_string_tuples_(vm["parm"].as<std::vector<std::string>>());
if (vm.count("path"))
path = true;
if (vm.count("preprocess"))
{
preprocess = true;
Expand Down
2 changes: 0 additions & 2 deletions src/commandline_options.hpp
Expand Up @@ -143,8 +143,6 @@ friend std::ostream& operator<<(std::ostream &os, const commandline_options& cmd
bool nosound;
/// True if --new-widgets was given on the command line. Hidden option to enable the new widget toolkit.
bool new_widgets;
/// True if --path was given on the command line. Prints the path to data directory and exits.
bool path;
/// True if --preprocess was given on the command line. Starts Wesnoth in preprocessor-only mode.
bool preprocess;
/// Defines that were given to the --preprocess option.
Expand Down
5 changes: 0 additions & 5 deletions src/tests/test_commandline_options.cpp
Expand Up @@ -65,7 +65,6 @@ BOOST_AUTO_TEST_CASE (test_empty_options)
BOOST_CHECK(!co.nomusic);
BOOST_CHECK(!co.nosound);
BOOST_CHECK(!co.new_widgets);
BOOST_CHECK(!co.path);
BOOST_CHECK(!co.preprocess);
BOOST_CHECK(!co.preprocess_defines);
BOOST_CHECK(!co.preprocess_input_macros);
Expand Down Expand Up @@ -142,7 +141,6 @@ BOOST_AUTO_TEST_CASE (test_default_options)
BOOST_CHECK(!co.nomusic);
BOOST_CHECK(!co.nosound);
BOOST_CHECK(!co.new_widgets);
BOOST_CHECK(!co.path);
BOOST_CHECK(!co.preprocess);
BOOST_CHECK(!co.preprocess_defines);
BOOST_CHECK(!co.preprocess_input_macros);
Expand Down Expand Up @@ -214,7 +212,6 @@ BOOST_AUTO_TEST_CASE (test_full_options)
"--nogui",
"--parm=7:parmfoo:valfoo",
"--parm=8:parmbar:valbar",
"--path",
"--preprocess", "preppathfoo", "preptargfoo",
"--preprocess-defines=DEFFOO,DEFBAR",
"--preprocess-input-macros=inmfoo",
Expand Down Expand Up @@ -300,7 +297,6 @@ BOOST_AUTO_TEST_CASE (test_full_options)
BOOST_CHECK(co.nomusic);
BOOST_CHECK(co.nosound);
BOOST_CHECK(co.new_widgets);
BOOST_CHECK(co.path);
BOOST_CHECK(co.preprocess && co.preprocess_path && co.preprocess_target);
BOOST_CHECK(*co.preprocess_path == "preppathfoo" && *co.preprocess_target == "preptargfoo");
BOOST_CHECK(co.preprocess_defines && co.preprocess_defines->size() == 2);
Expand Down Expand Up @@ -372,7 +368,6 @@ BOOST_AUTO_TEST_CASE (test_positional_options)
BOOST_CHECK(!co.nomusic);
BOOST_CHECK(!co.nosound);
BOOST_CHECK(!co.new_widgets);
BOOST_CHECK(!co.path);
BOOST_CHECK(!co.preprocess);
BOOST_CHECK(!co.preprocess_defines);
BOOST_CHECK(!co.preprocess_input_macros);
Expand Down
6 changes: 0 additions & 6 deletions src/wesnoth.cpp
Expand Up @@ -449,11 +449,6 @@ static int process_command_args(const commandline_options& cmdline_opts)
return 0;
}

if(cmdline_opts.path) {
std::cout << game_config::path << "\n";
return 0;
}

if(cmdline_opts.log_precise_timestamps) {
lg::precise_timestamps(true);
}
Expand Down Expand Up @@ -1035,7 +1030,6 @@ int main(int argc, char** argv)
if(args[k] == "--wconsole" ||
args[k] == "--help" ||
args[k] == "--logdomains" ||
args[k] == "--path" ||
args[k] == "--render-image" ||
args[k] == "--report" ||
args[k] == "-R" ||
Expand Down

0 comments on commit 23426de

Please sign in to comment.