Skip to content

Commit 60a9980

Browse files
committed
Merge pull request OpenXcom#1018 from myk002/allow_config_param
allow -config as an alias to -cfg
2 parents 9068959 + 60efd6f commit 60a9980

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ passing a commandline argument when running OpenXcom. For example:
8787

8888
openxcom -data "$HOME/bin/OpenXcom/usr/share/openxcom"
8989

90+
or, if you have a fully self-contained installation:
91+
92+
openxcom -data "$HOME/games/openxcom/data" -user "$HOME/games/openxcom/user" -config "$HOME/games/openxcom/config"
93+
9094
### Windows
9195

9296
User and Config folder:

src/Engine/Options.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ void loadArgs(int argc, char *argv[])
369369
{
370370
_userFolder = CrossPlatform::endPath(argv[i]);
371371
}
372-
else if (argname == "cfg")
372+
else if (argname == "cfg" || argname == "config")
373373
{
374374
_configFolder = CrossPlatform::endPath(argv[i]);
375375
}
@@ -401,7 +401,7 @@ bool showHelp(int argc, char *argv[])
401401
help << " use PATH as the default Data Folder instead of auto-detecting" << std::endl << std::endl;
402402
help << "-user PATH" << std::endl;
403403
help << " use PATH as the default User Folder instead of auto-detecting" << std::endl << std::endl;
404-
help << "-cfg PATH" << std::endl;
404+
help << "-cfg PATH or -config PATH" << std::endl;
405405
help << " use PATH as the default Config Folder instead of auto-detecting" << std::endl << std::endl;
406406
help << "-KEY VALUE" << std::endl;
407407
help << " set option KEY to VALUE instead of default/loaded value (eg. -displayWidth 640)" << std::endl << std::endl;
@@ -798,9 +798,9 @@ void updateOptions()
798798
save();
799799
}
800800

801-
// now apply options set on the command line, overriding defaults and those loaded from config file
801+
// now apply options set on the command line, overriding defaults and those loaded from config file
802802
//if (!_commandLine.empty())
803-
for (std::vector<OptionInfo>::iterator i = _info.begin(); i != _info.end(); ++i)
803+
for (std::vector<OptionInfo>::iterator i = _info.begin(); i != _info.end(); ++i)
804804
{
805805
i->load(_commandLine);
806806
}

0 commit comments

Comments
 (0)