summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-02-15 16:40:52 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-02-15 16:40:52 +0100
commitd6d906e2ad7b459882d628dfb07ed30ee36ed26b (patch)
treeadcdd0ef5bfbff1a8df77b1420bf2c877cd00c82 /src/main.cpp
parent1a5af5210f640d900efac540d781a80c90959c22 (diff)
parent4624f64d9bd89cd80030b2c0f143cfe4d2197229 (diff)
downloadmana-d6d906e2ad7b459882d628dfb07ed30ee36ed26b.tar.gz
mana-d6d906e2ad7b459882d628dfb07ed30ee36ed26b.tar.bz2
mana-d6d906e2ad7b459882d628dfb07ed30ee36ed26b.tar.xz
mana-d6d906e2ad7b459882d628dfb07ed30ee36ed26b.zip
Merge branch '0.0.28'
Conflicts: po/POTFILES.in src/main.cpp src/main.h tmw.cbp
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index aa8e2805..54320433 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -259,7 +259,8 @@ void setUpdatesDir()
*/
void init_engine(const Options &options)
{
- homeDir = std::string(PHYSFS_getUserDir()) + "/.tmw";
+ if (homeDir.empty())
+ homeDir = std::string(PHYSFS_getUserDir()) + "/.tmw";
#if defined WIN32
if (!CreateDirectory(homeDir.c_str(), 0) &&
GetLastError() != ERROR_ALREADY_EXISTS)
@@ -498,6 +499,7 @@ void printHelp()
<< _(" -d --data : Directory to load game data from") << std::endl
<< _(" -D --default : Bypass the login process with default settings") << std::endl
<< _(" -h --help : Display this help") << std::endl
+ << _(" -S --homedir : Directory to use as home directory") << std::endl
<< _(" -H --updatehost : Use this update host") << std::endl
<< _(" -p --playername : Login with this player") << std::endl
<< _(" -P --password : Login with this password") << std::endl
@@ -518,7 +520,7 @@ void printVersion()
void parseOptions(int argc, char *argv[], Options &options)
{
- const char *optstring = "hvud:U:P:Dp:C:H:";
+ const char *optstring = "hvud:U:P:Dp:C:H:S:";
const struct option long_options[] = {
{ "configfile", required_argument, 0, 'C' },
@@ -527,6 +529,7 @@ void parseOptions(int argc, char *argv[], Options &options)
{ "playername", required_argument, 0, 'p' },
{ "password", required_argument, 0, 'P' },
{ "help", no_argument, 0, 'h' },
+ { "homedir", required_argument, 0, 'S' },
{ "updatehost", required_argument, 0, 'H' },
{ "skipupdate", no_argument, 0, 'u' },
{ "username", required_argument, 0, 'U' },
@@ -573,6 +576,9 @@ void parseOptions(int argc, char *argv[], Options &options)
case 'v':
options.printVersion = true;
break;
+ case 'S':
+ homeDir = optarg;
+ break;
}
}
}