mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-06 01:49:42 +00:00
Avoid chained operator() calls to prevent formatting issues
This commit is contained in:
parent
7e6011751c
commit
6ae15f08e0
11 changed files with 167 additions and 181 deletions
|
@ -45,21 +45,18 @@ bool parseOptions (int argc, char** argv, Arguments &info)
|
|||
" Create an archive.\n\n"
|
||||
"Allowed options");
|
||||
|
||||
desc.add_options()
|
||||
("help,h", "print help message.")
|
||||
("version,v", "print version information and quit.")
|
||||
("long,l", "Include extra information in archive listing.")
|
||||
("full-path,f", "Create directory hierarchy on file extraction "
|
||||
"(always true for extractall).")
|
||||
;
|
||||
auto addOption = desc.add_options();
|
||||
addOption("help,h", "print help message.");
|
||||
addOption("version,v", "print version information and quit.");
|
||||
addOption("long,l", "Include extra information in archive listing.");
|
||||
addOption("full-path,f", "Create directory hierarchy on file extraction (always true for extractall).");
|
||||
|
||||
// input-file is hidden and used as a positional argument
|
||||
bpo::options_description hidden("Hidden Options");
|
||||
|
||||
hidden.add_options()
|
||||
( "mode,m", bpo::value<std::string>(), "bsatool mode")
|
||||
( "input-file,i", bpo::value< Files::MaybeQuotedPathContainer >(), "input file")
|
||||
;
|
||||
auto addHiddenOption = hidden.add_options();
|
||||
addHiddenOption("mode,m", bpo::value<std::string>(), "bsatool mode");
|
||||
addHiddenOption("input-file,i", bpo::value< Files::MaybeQuotedPathContainer >(), "input file");
|
||||
|
||||
bpo::positional_options_description p;
|
||||
p.add("mode", 1).add("input-file", 3);
|
||||
|
|
|
@ -39,41 +39,39 @@ namespace
|
|||
using Fallback::FallbackMap;
|
||||
|
||||
bpo::options_description result;
|
||||
auto addOption = result.add_options();
|
||||
addOption("help", "print help message");
|
||||
|
||||
result.add_options()
|
||||
("help", "print help message")
|
||||
addOption("version", "print version information and quit");
|
||||
|
||||
("version", "print version information and quit")
|
||||
addOption("data", bpo::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "data")
|
||||
->multitoken()->composing(), "set data directories (later directories have higher priority)");
|
||||
|
||||
("data", bpo::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "data")
|
||||
->multitoken()->composing(), "set data directories (later directories have higher priority)")
|
||||
addOption("data-local", bpo::value<Files::MaybeQuotedPathContainer::value_type>()->default_value(Files::MaybeQuotedPathContainer::value_type(), ""),
|
||||
"set local data directory (highest priority)");
|
||||
|
||||
("data-local", bpo::value<Files::MaybeQuotedPathContainer::value_type>()->default_value(Files::MaybeQuotedPathContainer::value_type(), ""),
|
||||
"set local data directory (highest priority)")
|
||||
addOption("fallback-archive", bpo::value<StringsVector>()->default_value(StringsVector(), "fallback-archive")
|
||||
->multitoken()->composing(), "set fallback BSA archives (later archives have higher priority)");
|
||||
|
||||
("fallback-archive", bpo::value<StringsVector>()->default_value(StringsVector(), "fallback-archive")
|
||||
->multitoken()->composing(), "set fallback BSA archives (later archives have higher priority)")
|
||||
addOption("resources", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), "resources"),
|
||||
"set resources directory");
|
||||
|
||||
("resources", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), "resources"),
|
||||
"set resources directory")
|
||||
addOption("content", bpo::value<StringsVector>()->default_value(StringsVector(), "")
|
||||
->multitoken()->composing(), "content file(s): esm/esp, or omwgame/omwaddon/omwscripts");
|
||||
|
||||
("content", bpo::value<StringsVector>()->default_value(StringsVector(), "")
|
||||
->multitoken()->composing(), "content file(s): esm/esp, or omwgame/omwaddon/omwscripts")
|
||||
addOption("fs-strict", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "strict file system handling (no case folding)");
|
||||
|
||||
("fs-strict", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "strict file system handling (no case folding)")
|
||||
|
||||
("encoding", bpo::value<std::string>()->
|
||||
addOption("encoding", bpo::value<std::string>()->
|
||||
default_value("win1252"),
|
||||
"Character encoding used in OpenMW game messages:\n"
|
||||
"\n\twin1250 - Central and Eastern European such as Polish, Czech, Slovak, Hungarian, Slovene, Bosnian, Croatian, Serbian (Latin script), Romanian and Albanian languages\n"
|
||||
"\n\twin1251 - Cyrillic alphabet such as Russian, Bulgarian, Serbian Cyrillic and other languages\n"
|
||||
"\n\twin1252 - Western European (Latin) alphabet, used by default")
|
||||
"\n\twin1252 - Western European (Latin) alphabet, used by default");
|
||||
|
||||
("fallback", bpo::value<FallbackMap>()->default_value(FallbackMap(), "")
|
||||
->multitoken()->composing(), "fallback values")
|
||||
addOption("fallback", bpo::value<FallbackMap>()->default_value(FallbackMap(), "")
|
||||
->multitoken()->composing(), "fallback values");
|
||||
;
|
||||
|
||||
Files::ConfigurationManager::addCommonOptions(result);
|
||||
|
||||
return result;
|
||||
|
|
|
@ -49,28 +49,27 @@ struct ESMData
|
|||
bool parseOptions (int argc, char** argv, Arguments &info)
|
||||
{
|
||||
bpo::options_description desc("Inspect and extract from Morrowind ES files (ESM, ESP, ESS)\nSyntax: esmtool [options] mode infile [outfile]\nAllowed modes:\n dump\t Dumps all readable data from the input file.\n clone\t Clones the input file to the output file.\n comp\t Compares the given files.\n\nAllowed options");
|
||||
|
||||
desc.add_options()
|
||||
("help,h", "print help message.")
|
||||
("version,v", "print version information and quit.")
|
||||
("raw,r", bpo::value<std::string>(),
|
||||
auto addOption = desc.add_options();
|
||||
addOption("help,h", "print help message.");
|
||||
addOption("version,v", "print version information and quit.");
|
||||
addOption("raw,r", bpo::value<std::string>(),
|
||||
"Show an unformatted list of all records and subrecords of given format:\n"
|
||||
"\n\tTES3"
|
||||
"\n\tTES4")
|
||||
"\n\tTES4");
|
||||
// The intention is that this option would interact better
|
||||
// with other modes including clone, dump, and raw.
|
||||
("type,t", bpo::value< std::vector<std::string> >(),
|
||||
addOption("type,t", bpo::value< std::vector<std::string> >(),
|
||||
"Show only records of this type (four character record code). May "
|
||||
"be specified multiple times. Only affects dump mode.")
|
||||
("name,n", bpo::value<std::string>(),
|
||||
"Show only the record with this name. Only affects dump mode.")
|
||||
("plain,p", "Print contents of dialogs, books and scripts. "
|
||||
"be specified multiple times. Only affects dump mode.");
|
||||
addOption("name,n", bpo::value<std::string>(),
|
||||
"Show only the record with this name. Only affects dump mode.");
|
||||
addOption("plain,p", "Print contents of dialogs, books and scripts. "
|
||||
"(skipped by default)"
|
||||
"Only affects dump mode.")
|
||||
("quiet,q", "Suppress all record information. Useful for speed tests.")
|
||||
("loadcells,C", "Browse through contents of all cells.")
|
||||
"Only affects dump mode.");
|
||||
addOption("quiet,q", "Suppress all record information. Useful for speed tests.");
|
||||
addOption("loadcells,C", "Browse through contents of all cells.");
|
||||
|
||||
( "encoding,e", bpo::value<std::string>(&(info.encoding))->
|
||||
addOption( "encoding,e", bpo::value<std::string>(&(info.encoding))->
|
||||
default_value("win1252"),
|
||||
"Character encoding used in ESMTool:\n"
|
||||
"\n\twin1250 - Central and Eastern European such as Polish, Czech, Slovak, Hungarian, Slovene, Bosnian, Croatian, Serbian (Latin script), Romanian and Albanian languages\n"
|
||||
|
@ -82,11 +81,9 @@ bool parseOptions (int argc, char** argv, Arguments &info)
|
|||
|
||||
// input-file is hidden and used as a positional argument
|
||||
bpo::options_description hidden("Hidden Options");
|
||||
|
||||
hidden.add_options()
|
||||
( "mode,m", bpo::value<std::string>(), "esmtool mode")
|
||||
( "input-file,i", bpo::value< Files::MaybeQuotedPathContainer >(), "input file")
|
||||
;
|
||||
auto addHiddenOption = hidden.add_options();
|
||||
addHiddenOption( "mode,m", bpo::value<std::string>(), "esmtool mode");
|
||||
addHiddenOption( "input-file,i", bpo::value< Files::MaybeQuotedPathContainer >(), "input file");
|
||||
|
||||
bpo::positional_options_description p;
|
||||
p.add("mode", 1).add("input-file", 2);
|
||||
|
|
|
@ -16,13 +16,12 @@ int main(int argc, char** argv)
|
|||
{
|
||||
bpo::options_description desc("Syntax: openmw-essimporter <options> infile.ess outfile.omwsave\nAllowed options");
|
||||
bpo::positional_options_description p_desc;
|
||||
desc.add_options()
|
||||
("help,h", "produce help message")
|
||||
("mwsave,m", bpo::value<Files::MaybeQuotedPath>(), "morrowind .ess save file")
|
||||
("output,o", bpo::value<Files::MaybeQuotedPath>(), "output file (.omwsave)")
|
||||
("compare,c", "compare two .ess files")
|
||||
("encoding", boost::program_options::value<std::string>()->default_value("win1252"), "encoding of the save file")
|
||||
;
|
||||
auto addOption = desc.add_options();
|
||||
addOption("help,h", "produce help message");
|
||||
addOption("mwsave,m", bpo::value<Files::MaybeQuotedPath>(), "morrowind .ess save file");
|
||||
addOption("output,o", bpo::value<Files::MaybeQuotedPath>(), "output file (.omwsave)");
|
||||
addOption("compare,c", "compare two .ess files");
|
||||
addOption("encoding", boost::program_options::value<std::string>()->default_value("win1252"), "encoding of the save file");
|
||||
p_desc.add("mwsave", 1).add("output", 1);
|
||||
Files::ConfigurationManager::addCommonOptions(desc);
|
||||
|
||||
|
@ -32,7 +31,6 @@ int main(int argc, char** argv)
|
|||
.options(desc)
|
||||
.positional(p_desc)
|
||||
.run();
|
||||
|
||||
bpo::store(parsed, variables);
|
||||
|
||||
if(variables.count("help") || !variables.count("mwsave") || !variables.count("output")) {
|
||||
|
|
|
@ -61,20 +61,20 @@ int wmain(int argc, wchar_t *wargv[]) {
|
|||
{
|
||||
bpo::options_description desc("Syntax: openmw-iniimporter <options> inifile configfile\nAllowed options");
|
||||
bpo::positional_options_description p_desc;
|
||||
desc.add_options()
|
||||
("help,h", "produce help message")
|
||||
("verbose,v", "verbose output")
|
||||
("ini,i", bpo::value<Files::MaybeQuotedPath>(), "morrowind.ini file")
|
||||
("cfg,c", bpo::value<Files::MaybeQuotedPath>(), "openmw.cfg file")
|
||||
("output,o", bpo::value<Files::MaybeQuotedPath>()->default_value({}), "openmw.cfg file")
|
||||
("game-files,g", "import esm and esp files")
|
||||
("fonts,f", "import bitmap fonts")
|
||||
("no-archives,A", "disable bsa archives import")
|
||||
("encoding,e", bpo::value<std::string>()-> default_value("win1252"),
|
||||
auto addOption = desc.add_options();
|
||||
addOption("help,h", "produce help message");
|
||||
addOption("verbose,v", "verbose output");
|
||||
addOption("ini,i", bpo::value<Files::MaybeQuotedPath>(), "morrowind.ini file");
|
||||
addOption("cfg,c", bpo::value<Files::MaybeQuotedPath>(), "openmw.cfg file");
|
||||
addOption("output,o", bpo::value<Files::MaybeQuotedPath>()->default_value({}), "openmw.cfg file");
|
||||
addOption("game-files,g", "import esm and esp files");
|
||||
addOption("fonts,f", "import bitmap fonts");
|
||||
addOption("no-archives,A", "disable bsa archives import");
|
||||
addOption("encoding,e", bpo::value<std::string>()-> default_value("win1252"),
|
||||
"Character encoding used in OpenMW game messages:\n"
|
||||
"\n\twin1250 - Central and Eastern European such as Polish, Czech, Slovak, Hungarian, Slovene, Bosnian, Croatian, Serbian (Latin script), Romanian and Albanian languages\n"
|
||||
"\n\twin1251 - Cyrillic alphabet such as Russian, Bulgarian, Serbian Cyrillic and other languages\n"
|
||||
"\n\twin1252 - Western European (Latin) alphabet, used by default")
|
||||
"\n\twin1252 - Western European (Latin) alphabet, used by default");
|
||||
;
|
||||
p_desc.add("ini", 1).add("cfg", 1);
|
||||
|
||||
|
@ -84,7 +84,6 @@ int wmain(int argc, wchar_t *wargv[]) {
|
|||
.options(desc)
|
||||
.positional(p_desc)
|
||||
.run();
|
||||
|
||||
bpo::store(parsed, vm);
|
||||
|
||||
if(vm.count("help") || !vm.count("ini") || !vm.count("cfg")) {
|
||||
|
|
|
@ -54,52 +54,51 @@ namespace NavMeshTool
|
|||
using Fallback::FallbackMap;
|
||||
|
||||
bpo::options_description result;
|
||||
auto addOption = result.add_options();
|
||||
addOption("help", "print help message");
|
||||
|
||||
result.add_options()
|
||||
("help", "print help message")
|
||||
addOption("version", "print version information and quit");
|
||||
|
||||
("version", "print version information and quit")
|
||||
addOption("data", bpo::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "data")
|
||||
->multitoken()->composing(), "set data directories (later directories have higher priority)");
|
||||
|
||||
("data", bpo::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "data")
|
||||
->multitoken()->composing(), "set data directories (later directories have higher priority)")
|
||||
addOption("data-local", bpo::value<Files::MaybeQuotedPathContainer::value_type>()->default_value(Files::MaybeQuotedPathContainer::value_type(), ""),
|
||||
"set local data directory (highest priority)");
|
||||
|
||||
("data-local", bpo::value<Files::MaybeQuotedPathContainer::value_type>()->default_value(Files::MaybeQuotedPathContainer::value_type(), ""),
|
||||
"set local data directory (highest priority)")
|
||||
addOption("fallback-archive", bpo::value<StringsVector>()->default_value(StringsVector(), "fallback-archive")
|
||||
->multitoken()->composing(), "set fallback BSA archives (later archives have higher priority)");
|
||||
|
||||
("fallback-archive", bpo::value<StringsVector>()->default_value(StringsVector(), "fallback-archive")
|
||||
->multitoken()->composing(), "set fallback BSA archives (later archives have higher priority)")
|
||||
addOption("resources", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), "resources"),
|
||||
"set resources directory");
|
||||
|
||||
("resources", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), "resources"),
|
||||
"set resources directory")
|
||||
addOption("content", bpo::value<StringsVector>()->default_value(StringsVector(), "")
|
||||
->multitoken()->composing(), "content file(s): esm/esp, or omwgame/omwaddon/omwscripts");
|
||||
|
||||
("content", bpo::value<StringsVector>()->default_value(StringsVector(), "")
|
||||
->multitoken()->composing(), "content file(s): esm/esp, or omwgame/omwaddon/omwscripts")
|
||||
addOption("fs-strict", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "strict file system handling (no case folding)");
|
||||
|
||||
("fs-strict", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "strict file system handling (no case folding)")
|
||||
|
||||
("encoding", bpo::value<std::string>()->
|
||||
addOption("encoding", bpo::value<std::string>()->
|
||||
default_value("win1252"),
|
||||
"Character encoding used in OpenMW game messages:\n"
|
||||
"\n\twin1250 - Central and Eastern European such as Polish, Czech, Slovak, Hungarian, Slovene, Bosnian, Croatian, Serbian (Latin script), Romanian and Albanian languages\n"
|
||||
"\n\twin1251 - Cyrillic alphabet such as Russian, Bulgarian, Serbian Cyrillic and other languages\n"
|
||||
"\n\twin1252 - Western European (Latin) alphabet, used by default")
|
||||
"\n\twin1252 - Western European (Latin) alphabet, used by default");
|
||||
|
||||
("fallback", bpo::value<Fallback::FallbackMap>()->default_value(Fallback::FallbackMap(), "")
|
||||
->multitoken()->composing(), "fallback values")
|
||||
addOption("fallback", bpo::value<Fallback::FallbackMap>()->default_value(Fallback::FallbackMap(), "")
|
||||
->multitoken()->composing(), "fallback values");
|
||||
|
||||
("threads", bpo::value<std::size_t>()->default_value(std::max<std::size_t>(std::thread::hardware_concurrency() - 1, 1)),
|
||||
"number of threads for parallel processing")
|
||||
addOption("threads", bpo::value<std::size_t>()->default_value(std::max<std::size_t>(std::thread::hardware_concurrency() - 1, 1)),
|
||||
"number of threads for parallel processing");
|
||||
|
||||
("process-interior-cells", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "build navmesh for interior cells")
|
||||
addOption("process-interior-cells", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "build navmesh for interior cells");
|
||||
|
||||
("remove-unused-tiles", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "remove tiles from cache that will not be used with current content profile")
|
||||
addOption("remove-unused-tiles", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "remove tiles from cache that will not be used with current content profile");
|
||||
|
||||
addOption("write-binary-log", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "write progress in binary messages to be consumed by the launcher");
|
||||
|
||||
("write-binary-log", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "write progress in binary messages to be consumed by the launcher")
|
||||
;
|
||||
Files::ConfigurationManager::addCommonOptions(result);
|
||||
|
||||
return result;
|
||||
|
|
|
@ -75,10 +75,9 @@ bool parseOptions (int argc, char** argv, std::vector<Files::MaybeQuotedPath> &f
|
|||
" niftool <nif files, BSA files, or directories>\n"
|
||||
" Scan the file or directories for nif errors.\n\n"
|
||||
"Allowed options");
|
||||
desc.add_options()
|
||||
("help,h", "print help message.")
|
||||
("input-file", bpo::value< Files::MaybeQuotedPathContainer >(), "input file")
|
||||
;
|
||||
auto addOption = desc.add_options();
|
||||
addOption("help,h", "print help message.");
|
||||
addOption("input-file", bpo::value< Files::MaybeQuotedPathContainer >(), "input file");
|
||||
|
||||
//Default option if none provided
|
||||
bpo::positional_options_description p;
|
||||
|
|
|
@ -89,19 +89,19 @@ boost::program_options::variables_map CS::Editor::readConfiguration()
|
|||
boost::program_options::variables_map variables;
|
||||
boost::program_options::options_description desc("Syntax: openmw-cs <options>\nAllowed options");
|
||||
|
||||
desc.add_options()
|
||||
("data", boost::program_options::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "data")->multitoken()->composing())
|
||||
("data-local", boost::program_options::value<Files::MaybeQuotedPathContainer::value_type>()->default_value(Files::MaybeQuotedPathContainer::value_type(), ""))
|
||||
("fs-strict", boost::program_options::value<bool>()->implicit_value(true)->default_value(false))
|
||||
("encoding", boost::program_options::value<std::string>()->default_value("win1252"))
|
||||
("resources", boost::program_options::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), "resources"))
|
||||
("fallback-archive", boost::program_options::value<std::vector<std::string>>()->
|
||||
default_value(std::vector<std::string>(), "fallback-archive")->multitoken())
|
||||
("fallback", boost::program_options::value<FallbackMap>()->default_value(FallbackMap(), "")
|
||||
->multitoken()->composing(), "fallback values")
|
||||
("script-blacklist", boost::program_options::value<std::vector<std::string>>()->default_value(std::vector<std::string>(), "")
|
||||
->multitoken(), "exclude specified script from the verifier (if the use of the blacklist is enabled)")
|
||||
("script-blacklist-use", boost::program_options::value<bool>()->implicit_value(true)
|
||||
auto addOption = desc.add_options();
|
||||
addOption("data", boost::program_options::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "data")->multitoken()->composing());
|
||||
addOption("data-local", boost::program_options::value<Files::MaybeQuotedPathContainer::value_type>()->default_value(Files::MaybeQuotedPathContainer::value_type(), ""));
|
||||
addOption("fs-strict", boost::program_options::value<bool>()->implicit_value(true)->default_value(false));
|
||||
addOption("encoding", boost::program_options::value<std::string>()->default_value("win1252"));
|
||||
addOption("resources", boost::program_options::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), "resources"));
|
||||
addOption("fallback-archive", boost::program_options::value<std::vector<std::string>>()->
|
||||
default_value(std::vector<std::string>(), "fallback-archive")->multitoken());
|
||||
addOption("fallback", boost::program_options::value<FallbackMap>()->default_value(FallbackMap(), "")
|
||||
->multitoken()->composing(), "fallback values");
|
||||
addOption("script-blacklist", boost::program_options::value<std::vector<std::string>>()->default_value(std::vector<std::string>(), "")
|
||||
->multitoken(), "exclude specified script from the verifier (if the use of the blacklist is enabled)");
|
||||
addOption("script-blacklist-use", boost::program_options::value<bool>()->implicit_value(true)
|
||||
->default_value(true), "enable script blacklisting");
|
||||
Files::ConfigurationManager::addCommonOptions(desc);
|
||||
|
||||
|
|
|
@ -18,92 +18,91 @@ namespace OpenMW
|
|||
bpo::options_description desc("Syntax: openmw <options>\nAllowed options");
|
||||
Files::ConfigurationManager::addCommonOptions(desc);
|
||||
|
||||
desc.add_options()
|
||||
("help", "print help message")
|
||||
("version", "print version information and quit")
|
||||
auto addOption = desc.add_options();
|
||||
addOption("help", "print help message");
|
||||
addOption("version", "print version information and quit");
|
||||
|
||||
("data", bpo::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "data")
|
||||
->multitoken()->composing(), "set data directories (later directories have higher priority)")
|
||||
addOption("data", bpo::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "data")
|
||||
->multitoken()->composing(), "set data directories (later directories have higher priority)");
|
||||
|
||||
("data-local", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), ""),
|
||||
"set local data directory (highest priority)")
|
||||
addOption("data-local", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), ""),
|
||||
"set local data directory (highest priority)");
|
||||
|
||||
("fallback-archive", bpo::value<StringsVector>()->default_value(StringsVector(), "fallback-archive")
|
||||
->multitoken()->composing(), "set fallback BSA archives (later archives have higher priority)")
|
||||
addOption("fallback-archive", bpo::value<StringsVector>()->default_value(StringsVector(), "fallback-archive")
|
||||
->multitoken()->composing(), "set fallback BSA archives (later archives have higher priority)");
|
||||
|
||||
("resources", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), "resources"),
|
||||
"set resources directory")
|
||||
addOption("resources", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), "resources"),
|
||||
"set resources directory");
|
||||
|
||||
("start", bpo::value<std::string>()->default_value(""),
|
||||
"set initial cell")
|
||||
addOption("start", bpo::value<std::string>()->default_value(""),
|
||||
"set initial cell");
|
||||
|
||||
("content", bpo::value<StringsVector>()->default_value(StringsVector(), "")
|
||||
->multitoken()->composing(), "content file(s): esm/esp, or omwgame/omwaddon/omwscripts")
|
||||
addOption("content", bpo::value<StringsVector>()->default_value(StringsVector(), "")
|
||||
->multitoken()->composing(), "content file(s): esm/esp, or omwgame/omwaddon/omwscripts");
|
||||
|
||||
("groundcover", bpo::value<StringsVector>()->default_value(StringsVector(), "")
|
||||
->multitoken()->composing(), "groundcover content file(s): esm/esp, or omwgame/omwaddon")
|
||||
addOption("groundcover", bpo::value<StringsVector>()->default_value(StringsVector(), "")
|
||||
->multitoken()->composing(), "groundcover content file(s): esm/esp, or omwgame/omwaddon");
|
||||
|
||||
("no-sound", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "disable all sounds")
|
||||
addOption("no-sound", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "disable all sounds");
|
||||
|
||||
("script-all", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "compile all scripts (excluding dialogue scripts) at startup")
|
||||
addOption("script-all", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "compile all scripts (excluding dialogue scripts) at startup");
|
||||
|
||||
("script-all-dialogue", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "compile all dialogue scripts at startup")
|
||||
addOption("script-all-dialogue", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "compile all dialogue scripts at startup");
|
||||
|
||||
("script-console", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "enable console-only script functionality")
|
||||
addOption("script-console", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "enable console-only script functionality");
|
||||
|
||||
("script-run", bpo::value<std::string>()->default_value(""),
|
||||
"select a file containing a list of console commands that is executed on startup")
|
||||
addOption("script-run", bpo::value<std::string>()->default_value(""),
|
||||
"select a file containing a list of console commands that is executed on startup");
|
||||
|
||||
("script-warn", bpo::value<int>()->implicit_value (1)
|
||||
addOption("script-warn", bpo::value<int>()->implicit_value (1)
|
||||
->default_value (1),
|
||||
"handling of warnings when compiling scripts\n"
|
||||
"\t0 - ignore warning\n"
|
||||
"\t1 - show warning but consider script as correctly compiled anyway\n"
|
||||
"\t2 - treat warnings as errors")
|
||||
"\t2 - treat warnings as errors");
|
||||
|
||||
("script-blacklist", bpo::value<StringsVector>()->default_value(StringsVector(), "")
|
||||
->multitoken()->composing(), "ignore the specified script (if the use of the blacklist is enabled)")
|
||||
addOption("script-blacklist", bpo::value<StringsVector>()->default_value(StringsVector(), "")
|
||||
->multitoken()->composing(), "ignore the specified script (if the use of the blacklist is enabled)");
|
||||
|
||||
("script-blacklist-use", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(true), "enable script blacklisting")
|
||||
addOption("script-blacklist-use", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(true), "enable script blacklisting");
|
||||
|
||||
("load-savegame", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), ""),
|
||||
"load a save game file on game startup (specify an absolute filename or a filename relative to the current working directory)")
|
||||
addOption("load-savegame", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), ""),
|
||||
"load a save game file on game startup (specify an absolute filename or a filename relative to the current working directory)");
|
||||
|
||||
("skip-menu", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "skip main menu on game startup")
|
||||
addOption("skip-menu", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "skip main menu on game startup");
|
||||
|
||||
("new-game", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "run new game sequence (ignored if skip-menu=0)")
|
||||
addOption("new-game", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "run new game sequence (ignored if skip-menu=0)");
|
||||
|
||||
("fs-strict", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "strict file system handling (no case folding)")
|
||||
addOption("fs-strict", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "strict file system handling (no case folding)");
|
||||
|
||||
("encoding", bpo::value<std::string>()->
|
||||
addOption("encoding", bpo::value<std::string>()->
|
||||
default_value("win1252"),
|
||||
"Character encoding used in OpenMW game messages:\n"
|
||||
"\n\twin1250 - Central and Eastern European such as Polish, Czech, Slovak, Hungarian, Slovene, Bosnian, Croatian, Serbian (Latin script), Romanian and Albanian languages\n"
|
||||
"\n\twin1251 - Cyrillic alphabet such as Russian, Bulgarian, Serbian Cyrillic and other languages\n"
|
||||
"\n\twin1252 - Western European (Latin) alphabet, used by default")
|
||||
"\n\twin1252 - Western European (Latin) alphabet, used by default");
|
||||
|
||||
("fallback", bpo::value<Fallback::FallbackMap>()->default_value(Fallback::FallbackMap(), "")
|
||||
->multitoken()->composing(), "fallback values")
|
||||
addOption("fallback", bpo::value<Fallback::FallbackMap>()->default_value(Fallback::FallbackMap(), "")
|
||||
->multitoken()->composing(), "fallback values");
|
||||
|
||||
("no-grab", bpo::value<bool>()->implicit_value(true)->default_value(false), "Don't grab mouse cursor")
|
||||
addOption("no-grab", bpo::value<bool>()->implicit_value(true)->default_value(false), "Don't grab mouse cursor");
|
||||
|
||||
("export-fonts", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "Export Morrowind .fnt fonts to PNG image and XML file in current directory")
|
||||
addOption("export-fonts", bpo::value<bool>()->implicit_value(true)
|
||||
->default_value(false), "Export Morrowind .fnt fonts to PNG image and XML file in current directory");
|
||||
|
||||
("activate-dist", bpo::value <int> ()->default_value (-1), "activation distance override")
|
||||
addOption("activate-dist", bpo::value <int> ()->default_value (-1), "activation distance override");
|
||||
|
||||
("random-seed", bpo::value <unsigned int> ()
|
||||
addOption("random-seed", bpo::value <unsigned int> ()
|
||||
->default_value(Misc::Rng::generateDefaultSeed()),
|
||||
"seed value for random number generator")
|
||||
;
|
||||
"seed value for random number generator");
|
||||
|
||||
return desc;
|
||||
}
|
||||
|
|
|
@ -61,11 +61,11 @@ struct ContentFileTest : public ::testing::Test
|
|||
boost::program_options::variables_map variables;
|
||||
|
||||
boost::program_options::options_description desc("Allowed options");
|
||||
desc.add_options()
|
||||
("data", boost::program_options::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "data")->multitoken()->composing())
|
||||
("content", boost::program_options::value<std::vector<std::string>>()->default_value(std::vector<std::string>(), "")
|
||||
->multitoken()->composing(), "content file(s): esm/esp, or omwgame/omwaddon")
|
||||
("data-local", boost::program_options::value<Files::MaybeQuotedPathContainer::value_type>()->default_value(Files::MaybeQuotedPathContainer::value_type(), ""));
|
||||
auto addOption = desc.add_options();
|
||||
addOption("data", boost::program_options::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "data")->multitoken()->composing());
|
||||
addOption("content", boost::program_options::value<std::vector<std::string>>()->default_value(std::vector<std::string>(), "")
|
||||
->multitoken()->composing(), "content file(s): esm/esp, or omwgame/omwaddon");
|
||||
addOption("data-local", boost::program_options::value<Files::MaybeQuotedPathContainer::value_type>()->default_value(Files::MaybeQuotedPathContainer::value_type(), ""));
|
||||
Files::ConfigurationManager::addCommonOptions(desc);
|
||||
|
||||
mConfigurationManager.readConfiguration(variables, desc, true);
|
||||
|
|
|
@ -177,12 +177,12 @@ void ConfigurationManager::addExtraConfigDirs(std::stack<std::filesystem::path>&
|
|||
|
||||
void ConfigurationManager::addCommonOptions(bpo::options_description& description)
|
||||
{
|
||||
description.add_options()
|
||||
("config", bpo::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "")
|
||||
->multitoken()->composing(), "additional config directories")
|
||||
("replace", bpo::value<std::vector<std::string>>()->default_value(std::vector<std::string>(), "")->multitoken()->composing(),
|
||||
"settings where the values from the current source should replace those from lower-priority sources instead of being appended")
|
||||
("user-data", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), ""),
|
||||
auto addOption = description.add_options();
|
||||
addOption("config", bpo::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "")
|
||||
->multitoken()->composing(), "additional config directories");
|
||||
addOption("replace", bpo::value<std::vector<std::string>>()->default_value(std::vector<std::string>(), "")->multitoken()->composing(),
|
||||
"settings where the values from the current source should replace those from lower-priority sources instead of being appended");
|
||||
addOption("user-data", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), ""),
|
||||
"set user data directory (used for saves, screenshots, etc)");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue