From: Ingo Ruhnke Date: Mon, 18 Aug 2014 08:10:14 +0000 (+0200) Subject: Removed dependency between CommandLineArguments and Physfs X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=3628d155d2a205da0b11b75f7be2d301727c8af5;p=supertux.git Removed dependency between CommandLineArguments and Physfs --- diff --git a/src/supertux/command_line_arguments.cpp b/src/supertux/command_line_arguments.cpp index 3877b461e..e5dc3a126 100644 --- a/src/supertux/command_line_arguments.cpp +++ b/src/supertux/command_line_arguments.cpp @@ -65,7 +65,7 @@ CommandLineArguments::print_datadir() } void -CommandLineArguments::print_help(const char* argv0) +CommandLineArguments::print_help(const char* arg0) { std::string default_user_data_dir = std::string(PHYSFS_getUserDir()) + WRITEDIR_NAME; @@ -97,10 +97,9 @@ CommandLineArguments::print_help(const char* argv0) "\n" "Environment variables:\n" " SUPERTUX2_USER_DIR Directory for user data (savegames, etc.);\n" - " default %s\n" "\n" )) - % argv0 % default_user_data_dir + % arg0 << std::flush; } diff --git a/src/supertux/command_line_arguments.hpp b/src/supertux/command_line_arguments.hpp index d1c254b7b..d47215c56 100644 --- a/src/supertux/command_line_arguments.hpp +++ b/src/supertux/command_line_arguments.hpp @@ -75,7 +75,7 @@ public: void parse_args(int argc, char** argv); - void print_help(const char* argv0); + void print_help(const char* arg0); void print_version(); void print_datadir(); diff --git a/src/supertux/main.cpp b/src/supertux/main.cpp index d03c54a86..8342e432a 100644 --- a/src/supertux/main.cpp +++ b/src/supertux/main.cpp @@ -368,10 +368,6 @@ Main::run(int argc, char** argv) { CommandLineArguments args; - // Do this before pre_parse_commandline, because --help now shows the - // default user data dir. - PhysfsSubsystem physfs_subsystem(argv[0]); - try { args.parse_args(argc, argv); @@ -383,6 +379,8 @@ Main::run(int argc, char** argv) return EXIT_FAILURE; } + PhysfsSubsystem physfs_subsystem(argv[0]); + timelog("config"); ConfigSubsystem config_subsystem; args.merge_into(*g_config);