parent
639fb7158e
commit
5cd12df0af
1 changed files with 13 additions and 0 deletions
|
@ -89,6 +89,7 @@
|
|||
|
||||
#include <boost/iostreams/filtering_stream.hpp> // for filtering_stream
|
||||
#include <boost/program_options/errors.hpp> // for error
|
||||
#include <boost/algorithm/string/predicate.hpp> // for checking cmdline options
|
||||
#include <optional>
|
||||
|
||||
#include <algorithm> // for transform
|
||||
|
@ -1157,6 +1158,18 @@ int main(int argc, char** argv)
|
|||
PLAIN_LOG << "Automatically found a possible data directory at: " << auto_dir;
|
||||
}
|
||||
game_config::path = std::move(auto_dir);
|
||||
} else if(game_config::path.empty()) {
|
||||
bool data_dir_specified = false;
|
||||
for(int i=0;i<argc;i++) {
|
||||
if(std::string(argv[i]) == "--data-dir" || boost::algorithm::starts_with(argv[i], "--data-dir=")) {
|
||||
data_dir_specified = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!data_dir_specified) {
|
||||
PLAIN_LOG << "Cannot find a data directory. Specify one with --data-dir";
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue