Avoid chained operator() calls to prevent formatting issues

make_linux_ci_do_zoomies
elsid 2 years ago
parent 7e6011751c
commit 6ae15f08e0
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -45,21 +45,18 @@ bool parseOptions (int argc, char** argv, Arguments &info)
" Create an archive.\n\n" " Create an archive.\n\n"
"Allowed options"); "Allowed options");
desc.add_options() auto addOption = desc.add_options();
("help,h", "print help message.") addOption("help,h", "print help message.");
("version,v", "print version information and quit.") addOption("version,v", "print version information and quit.");
("long,l", "Include extra information in archive listing.") addOption("long,l", "Include extra information in archive listing.");
("full-path,f", "Create directory hierarchy on file extraction " addOption("full-path,f", "Create directory hierarchy on file extraction (always true for extractall).");
"(always true for extractall).")
;
// input-file is hidden and used as a positional argument // input-file is hidden and used as a positional argument
bpo::options_description hidden("Hidden Options"); bpo::options_description hidden("Hidden Options");
hidden.add_options() auto addHiddenOption = hidden.add_options();
( "mode,m", bpo::value<std::string>(), "bsatool mode") addHiddenOption("mode,m", bpo::value<std::string>(), "bsatool mode");
( "input-file,i", bpo::value< Files::MaybeQuotedPathContainer >(), "input file") addHiddenOption("input-file,i", bpo::value< Files::MaybeQuotedPathContainer >(), "input file");
;
bpo::positional_options_description p; bpo::positional_options_description p;
p.add("mode", 1).add("input-file", 3); p.add("mode", 1).add("input-file", 3);

@ -39,41 +39,39 @@ namespace
using Fallback::FallbackMap; using Fallback::FallbackMap;
bpo::options_description result; bpo::options_description result;
auto addOption = result.add_options();
addOption("help", "print help message");
result.add_options() addOption("version", "print version information and quit");
("help", "print help message")
("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") addOption("data-local", bpo::value<Files::MaybeQuotedPathContainer::value_type>()->default_value(Files::MaybeQuotedPathContainer::value_type(), ""),
->multitoken()->composing(), "set data directories (later directories have higher priority)") "set local data directory (highest priority)");
("data-local", bpo::value<Files::MaybeQuotedPathContainer::value_type>()->default_value(Files::MaybeQuotedPathContainer::value_type(), ""), addOption("fallback-archive", bpo::value<StringsVector>()->default_value(StringsVector(), "fallback-archive")
"set local data directory (highest priority)") ->multitoken()->composing(), "set fallback BSA archives (later archives have higher priority)");
("fallback-archive", bpo::value<StringsVector>()->default_value(StringsVector(), "fallback-archive") addOption("resources", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), "resources"),
->multitoken()->composing(), "set fallback BSA archives (later archives have higher priority)") "set resources directory");
("resources", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), "resources"), addOption("content", bpo::value<StringsVector>()->default_value(StringsVector(), "")
"set resources directory") ->multitoken()->composing(), "content file(s): esm/esp, or omwgame/omwaddon/omwscripts");
("content", bpo::value<StringsVector>()->default_value(StringsVector(), "") addOption("fs-strict", bpo::value<bool>()->implicit_value(true)
->multitoken()->composing(), "content file(s): esm/esp, or omwgame/omwaddon/omwscripts") ->default_value(false), "strict file system handling (no case folding)");
("fs-strict", bpo::value<bool>()->implicit_value(true) addOption("encoding", bpo::value<std::string>()->
->default_value(false), "strict file system handling (no case folding)")
("encoding", bpo::value<std::string>()->
default_value("win1252"), default_value("win1252"),
"Character encoding used in OpenMW game messages:\n" "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\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\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(), "") addOption("fallback", bpo::value<FallbackMap>()->default_value(FallbackMap(), "")
->multitoken()->composing(), "fallback values") ->multitoken()->composing(), "fallback values");
; ;
Files::ConfigurationManager::addCommonOptions(result); Files::ConfigurationManager::addCommonOptions(result);
return result; return result;

@ -49,28 +49,27 @@ struct ESMData
bool parseOptions (int argc, char** argv, Arguments &info) 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"); 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");
auto addOption = desc.add_options();
desc.add_options() addOption("help,h", "print help message.");
("help,h", "print help message.") addOption("version,v", "print version information and quit.");
("version,v", "print version information and quit.") addOption("raw,r", bpo::value<std::string>(),
("raw,r", bpo::value<std::string>(),
"Show an unformatted list of all records and subrecords of given format:\n" "Show an unformatted list of all records and subrecords of given format:\n"
"\n\tTES3" "\n\tTES3"
"\n\tTES4") "\n\tTES4");
// The intention is that this option would interact better // The intention is that this option would interact better
// with other modes including clone, dump, and raw. // 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 " "Show only records of this type (four character record code). May "
"be specified multiple times. Only affects dump mode.") "be specified multiple times. Only affects dump mode.");
("name,n", bpo::value<std::string>(), addOption("name,n", bpo::value<std::string>(),
"Show only the record with this name. Only affects dump mode.") "Show only the record with this name. Only affects dump mode.");
("plain,p", "Print contents of dialogs, books and scripts. " addOption("plain,p", "Print contents of dialogs, books and scripts. "
"(skipped by default)" "(skipped by default)"
"Only affects dump mode.") "Only affects dump mode.");
("quiet,q", "Suppress all record information. Useful for speed tests.") addOption("quiet,q", "Suppress all record information. Useful for speed tests.");
("loadcells,C", "Browse through contents of all cells.") 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"), default_value("win1252"),
"Character encoding used in ESMTool:\n" "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" "\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 // input-file is hidden and used as a positional argument
bpo::options_description hidden("Hidden Options"); bpo::options_description hidden("Hidden Options");
auto addHiddenOption = hidden.add_options();
hidden.add_options() addHiddenOption( "mode,m", bpo::value<std::string>(), "esmtool mode");
( "mode,m", bpo::value<std::string>(), "esmtool mode") addHiddenOption( "input-file,i", bpo::value< Files::MaybeQuotedPathContainer >(), "input file");
( "input-file,i", bpo::value< Files::MaybeQuotedPathContainer >(), "input file")
;
bpo::positional_options_description p; bpo::positional_options_description p;
p.add("mode", 1).add("input-file", 2); 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::options_description desc("Syntax: openmw-essimporter <options> infile.ess outfile.omwsave\nAllowed options");
bpo::positional_options_description p_desc; bpo::positional_options_description p_desc;
desc.add_options() auto addOption = desc.add_options();
("help,h", "produce help message") addOption("help,h", "produce help message");
("mwsave,m", bpo::value<Files::MaybeQuotedPath>(), "morrowind .ess save file") addOption("mwsave,m", bpo::value<Files::MaybeQuotedPath>(), "morrowind .ess save file");
("output,o", bpo::value<Files::MaybeQuotedPath>(), "output file (.omwsave)") addOption("output,o", bpo::value<Files::MaybeQuotedPath>(), "output file (.omwsave)");
("compare,c", "compare two .ess files") addOption("compare,c", "compare two .ess files");
("encoding", boost::program_options::value<std::string>()->default_value("win1252"), "encoding of the save file") addOption("encoding", boost::program_options::value<std::string>()->default_value("win1252"), "encoding of the save file");
;
p_desc.add("mwsave", 1).add("output", 1); p_desc.add("mwsave", 1).add("output", 1);
Files::ConfigurationManager::addCommonOptions(desc); Files::ConfigurationManager::addCommonOptions(desc);
@ -32,7 +31,6 @@ int main(int argc, char** argv)
.options(desc) .options(desc)
.positional(p_desc) .positional(p_desc)
.run(); .run();
bpo::store(parsed, variables); bpo::store(parsed, variables);
if(variables.count("help") || !variables.count("mwsave") || !variables.count("output")) { 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::options_description desc("Syntax: openmw-iniimporter <options> inifile configfile\nAllowed options");
bpo::positional_options_description p_desc; bpo::positional_options_description p_desc;
desc.add_options() auto addOption = desc.add_options();
("help,h", "produce help message") addOption("help,h", "produce help message");
("verbose,v", "verbose output") addOption("verbose,v", "verbose output");
("ini,i", bpo::value<Files::MaybeQuotedPath>(), "morrowind.ini file") addOption("ini,i", bpo::value<Files::MaybeQuotedPath>(), "morrowind.ini file");
("cfg,c", bpo::value<Files::MaybeQuotedPath>(), "openmw.cfg file") addOption("cfg,c", bpo::value<Files::MaybeQuotedPath>(), "openmw.cfg file");
("output,o", bpo::value<Files::MaybeQuotedPath>()->default_value({}), "openmw.cfg file") addOption("output,o", bpo::value<Files::MaybeQuotedPath>()->default_value({}), "openmw.cfg file");
("game-files,g", "import esm and esp files") addOption("game-files,g", "import esm and esp files");
("fonts,f", "import bitmap fonts") addOption("fonts,f", "import bitmap fonts");
("no-archives,A", "disable bsa archives import") addOption("no-archives,A", "disable bsa archives import");
("encoding,e", bpo::value<std::string>()-> default_value("win1252"), addOption("encoding,e", bpo::value<std::string>()-> default_value("win1252"),
"Character encoding used in OpenMW game messages:\n" "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\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\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); p_desc.add("ini", 1).add("cfg", 1);
@ -84,7 +84,6 @@ int wmain(int argc, wchar_t *wargv[]) {
.options(desc) .options(desc)
.positional(p_desc) .positional(p_desc)
.run(); .run();
bpo::store(parsed, vm); bpo::store(parsed, vm);
if(vm.count("help") || !vm.count("ini") || !vm.count("cfg")) { if(vm.count("help") || !vm.count("ini") || !vm.count("cfg")) {

@ -54,52 +54,51 @@ namespace NavMeshTool
using Fallback::FallbackMap; using Fallback::FallbackMap;
bpo::options_description result; bpo::options_description result;
auto addOption = result.add_options();
addOption("help", "print help message");
result.add_options() addOption("version", "print version information and quit");
("help", "print help message")
("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") addOption("data-local", bpo::value<Files::MaybeQuotedPathContainer::value_type>()->default_value(Files::MaybeQuotedPathContainer::value_type(), ""),
->multitoken()->composing(), "set data directories (later directories have higher priority)") "set local data directory (highest priority)");
("data-local", bpo::value<Files::MaybeQuotedPathContainer::value_type>()->default_value(Files::MaybeQuotedPathContainer::value_type(), ""), addOption("fallback-archive", bpo::value<StringsVector>()->default_value(StringsVector(), "fallback-archive")
"set local data directory (highest priority)") ->multitoken()->composing(), "set fallback BSA archives (later archives have higher priority)");
("fallback-archive", bpo::value<StringsVector>()->default_value(StringsVector(), "fallback-archive") addOption("resources", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), "resources"),
->multitoken()->composing(), "set fallback BSA archives (later archives have higher priority)") "set resources directory");
("resources", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), "resources"), addOption("content", bpo::value<StringsVector>()->default_value(StringsVector(), "")
"set resources directory") ->multitoken()->composing(), "content file(s): esm/esp, or omwgame/omwaddon/omwscripts");
("content", bpo::value<StringsVector>()->default_value(StringsVector(), "") addOption("fs-strict", bpo::value<bool>()->implicit_value(true)
->multitoken()->composing(), "content file(s): esm/esp, or omwgame/omwaddon/omwscripts") ->default_value(false), "strict file system handling (no case folding)");
("fs-strict", bpo::value<bool>()->implicit_value(true) addOption("encoding", bpo::value<std::string>()->
->default_value(false), "strict file system handling (no case folding)")
("encoding", bpo::value<std::string>()->
default_value("win1252"), default_value("win1252"),
"Character encoding used in OpenMW game messages:\n" "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\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\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");
addOption("fallback", bpo::value<Fallback::FallbackMap>()->default_value(Fallback::FallbackMap(), "")
->multitoken()->composing(), "fallback values");
("fallback", bpo::value<Fallback::FallbackMap>()->default_value(Fallback::FallbackMap(), "") addOption("threads", bpo::value<std::size_t>()->default_value(std::max<std::size_t>(std::thread::hardware_concurrency() - 1, 1)),
->multitoken()->composing(), "fallback values") "number of threads for parallel processing");
("threads", bpo::value<std::size_t>()->default_value(std::max<std::size_t>(std::thread::hardware_concurrency() - 1, 1)), addOption("process-interior-cells", bpo::value<bool>()->implicit_value(true)
"number of threads for parallel processing") ->default_value(false), "build navmesh for interior cells");
("process-interior-cells", bpo::value<bool>()->implicit_value(true) addOption("remove-unused-tiles", bpo::value<bool>()->implicit_value(true)
->default_value(false), "build navmesh for interior cells") ->default_value(false), "remove tiles from cache that will not be used with current content profile");
("remove-unused-tiles", bpo::value<bool>()->implicit_value(true) addOption("write-binary-log", bpo::value<bool>()->implicit_value(true)
->default_value(false), "remove tiles from cache that will not be used with current content profile") ->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); Files::ConfigurationManager::addCommonOptions(result);
return 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" " niftool <nif files, BSA files, or directories>\n"
" Scan the file or directories for nif errors.\n\n" " Scan the file or directories for nif errors.\n\n"
"Allowed options"); "Allowed options");
desc.add_options() auto addOption = desc.add_options();
("help,h", "print help message.") addOption("help,h", "print help message.");
("input-file", bpo::value< Files::MaybeQuotedPathContainer >(), "input file") addOption("input-file", bpo::value< Files::MaybeQuotedPathContainer >(), "input file");
;
//Default option if none provided //Default option if none provided
bpo::positional_options_description p; 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::variables_map variables;
boost::program_options::options_description desc("Syntax: openmw-cs <options>\nAllowed options"); boost::program_options::options_description desc("Syntax: openmw-cs <options>\nAllowed options");
desc.add_options() auto addOption = desc.add_options();
("data", boost::program_options::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "data")->multitoken()->composing()) addOption("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(), "")) addOption("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)) addOption("fs-strict", boost::program_options::value<bool>()->implicit_value(true)->default_value(false));
("encoding", boost::program_options::value<std::string>()->default_value("win1252")) addOption("encoding", boost::program_options::value<std::string>()->default_value("win1252"));
("resources", boost::program_options::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), "resources")) addOption("resources", boost::program_options::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), "resources"));
("fallback-archive", boost::program_options::value<std::vector<std::string>>()-> addOption("fallback-archive", boost::program_options::value<std::vector<std::string>>()->
default_value(std::vector<std::string>(), "fallback-archive")->multitoken()) default_value(std::vector<std::string>(), "fallback-archive")->multitoken());
("fallback", boost::program_options::value<FallbackMap>()->default_value(FallbackMap(), "") addOption("fallback", boost::program_options::value<FallbackMap>()->default_value(FallbackMap(), "")
->multitoken()->composing(), "fallback values") ->multitoken()->composing(), "fallback values");
("script-blacklist", boost::program_options::value<std::vector<std::string>>()->default_value(std::vector<std::string>(), "") 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)") ->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) addOption("script-blacklist-use", boost::program_options::value<bool>()->implicit_value(true)
->default_value(true), "enable script blacklisting"); ->default_value(true), "enable script blacklisting");
Files::ConfigurationManager::addCommonOptions(desc); Files::ConfigurationManager::addCommonOptions(desc);

@ -18,92 +18,91 @@ namespace OpenMW
bpo::options_description desc("Syntax: openmw <options>\nAllowed options"); bpo::options_description desc("Syntax: openmw <options>\nAllowed options");
Files::ConfigurationManager::addCommonOptions(desc); Files::ConfigurationManager::addCommonOptions(desc);
desc.add_options() auto addOption = desc.add_options();
("help", "print help message") addOption("help", "print help message");
("version", "print version information and quit") addOption("version", "print version information and quit");
("data", bpo::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "data") addOption("data", bpo::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "data")
->multitoken()->composing(), "set data directories (later directories have higher priority)") ->multitoken()->composing(), "set data directories (later directories have higher priority)");
("data-local", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), ""), addOption("data-local", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), ""),
"set local data directory (highest priority)") "set local data directory (highest priority)");
("fallback-archive", bpo::value<StringsVector>()->default_value(StringsVector(), "fallback-archive") addOption("fallback-archive", bpo::value<StringsVector>()->default_value(StringsVector(), "fallback-archive")
->multitoken()->composing(), "set fallback BSA archives (later archives have higher priority)") ->multitoken()->composing(), "set fallback BSA archives (later archives have higher priority)");
("resources", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), "resources"), addOption("resources", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), "resources"),
"set resources directory") "set resources directory");
("start", bpo::value<std::string>()->default_value(""), addOption("start", bpo::value<std::string>()->default_value(""),
"set initial cell") "set initial cell");
("content", bpo::value<StringsVector>()->default_value(StringsVector(), "") addOption("content", bpo::value<StringsVector>()->default_value(StringsVector(), "")
->multitoken()->composing(), "content file(s): esm/esp, or omwgame/omwaddon/omwscripts") ->multitoken()->composing(), "content file(s): esm/esp, or omwgame/omwaddon/omwscripts");
("groundcover", bpo::value<StringsVector>()->default_value(StringsVector(), "") addOption("groundcover", bpo::value<StringsVector>()->default_value(StringsVector(), "")
->multitoken()->composing(), "groundcover content file(s): esm/esp, or omwgame/omwaddon") ->multitoken()->composing(), "groundcover content file(s): esm/esp, or omwgame/omwaddon");
("no-sound", bpo::value<bool>()->implicit_value(true) addOption("no-sound", bpo::value<bool>()->implicit_value(true)
->default_value(false), "disable all sounds") ->default_value(false), "disable all sounds");
("script-all", bpo::value<bool>()->implicit_value(true) addOption("script-all", bpo::value<bool>()->implicit_value(true)
->default_value(false), "compile all scripts (excluding dialogue scripts) at startup") ->default_value(false), "compile all scripts (excluding dialogue scripts) at startup");
("script-all-dialogue", bpo::value<bool>()->implicit_value(true) addOption("script-all-dialogue", bpo::value<bool>()->implicit_value(true)
->default_value(false), "compile all dialogue scripts at startup") ->default_value(false), "compile all dialogue scripts at startup");
("script-console", bpo::value<bool>()->implicit_value(true) addOption("script-console", bpo::value<bool>()->implicit_value(true)
->default_value(false), "enable console-only script functionality") ->default_value(false), "enable console-only script functionality");
("script-run", bpo::value<std::string>()->default_value(""), addOption("script-run", bpo::value<std::string>()->default_value(""),
"select a file containing a list of console commands that is executed on startup") "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), ->default_value (1),
"handling of warnings when compiling scripts\n" "handling of warnings when compiling scripts\n"
"\t0 - ignore warning\n" "\t0 - ignore warning\n"
"\t1 - show warning but consider script as correctly compiled anyway\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(), "") addOption("script-blacklist", bpo::value<StringsVector>()->default_value(StringsVector(), "")
->multitoken()->composing(), "ignore the specified script (if the use of the blacklist is enabled)") ->multitoken()->composing(), "ignore the specified script (if the use of the blacklist is enabled)");
("script-blacklist-use", bpo::value<bool>()->implicit_value(true) addOption("script-blacklist-use", bpo::value<bool>()->implicit_value(true)
->default_value(true), "enable script blacklisting") ->default_value(true), "enable script blacklisting");
("load-savegame", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), ""), 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)") "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) addOption("skip-menu", bpo::value<bool>()->implicit_value(true)
->default_value(false), "skip main menu on game startup") ->default_value(false), "skip main menu on game startup");
("new-game", bpo::value<bool>()->implicit_value(true) addOption("new-game", bpo::value<bool>()->implicit_value(true)
->default_value(false), "run new game sequence (ignored if skip-menu=0)") ->default_value(false), "run new game sequence (ignored if skip-menu=0)");
("fs-strict", bpo::value<bool>()->implicit_value(true) addOption("fs-strict", bpo::value<bool>()->implicit_value(true)
->default_value(false), "strict file system handling (no case folding)") ->default_value(false), "strict file system handling (no case folding)");
("encoding", bpo::value<std::string>()-> addOption("encoding", bpo::value<std::string>()->
default_value("win1252"), default_value("win1252"),
"Character encoding used in OpenMW game messages:\n" "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\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\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(), "") addOption("fallback", bpo::value<Fallback::FallbackMap>()->default_value(Fallback::FallbackMap(), "")
->multitoken()->composing(), "fallback values") ->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) 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") ->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()), ->default_value(Misc::Rng::generateDefaultSeed()),
"seed value for random number generator") "seed value for random number generator");
;
return desc; return desc;
} }

@ -61,11 +61,11 @@ struct ContentFileTest : public ::testing::Test
boost::program_options::variables_map variables; boost::program_options::variables_map variables;
boost::program_options::options_description desc("Allowed options"); boost::program_options::options_description desc("Allowed options");
desc.add_options() auto addOption = desc.add_options();
("data", boost::program_options::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "data")->multitoken()->composing()) addOption("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>(), "") 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") ->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(), "")); addOption("data-local", boost::program_options::value<Files::MaybeQuotedPathContainer::value_type>()->default_value(Files::MaybeQuotedPathContainer::value_type(), ""));
Files::ConfigurationManager::addCommonOptions(desc); Files::ConfigurationManager::addCommonOptions(desc);
mConfigurationManager.readConfiguration(variables, desc, true); mConfigurationManager.readConfiguration(variables, desc, true);

@ -177,12 +177,12 @@ void ConfigurationManager::addExtraConfigDirs(std::stack<std::filesystem::path>&
void ConfigurationManager::addCommonOptions(bpo::options_description& description) void ConfigurationManager::addCommonOptions(bpo::options_description& description)
{ {
description.add_options() auto addOption = description.add_options();
("config", bpo::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "") addOption("config", bpo::value<Files::MaybeQuotedPathContainer>()->default_value(Files::MaybeQuotedPathContainer(), "")
->multitoken()->composing(), "additional config directories") ->multitoken()->composing(), "additional config directories");
("replace", bpo::value<std::vector<std::string>>()->default_value(std::vector<std::string>(), "")->multitoken()->composing(), 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") "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(), ""), addOption("user-data", bpo::value<Files::MaybeQuotedPath>()->default_value(Files::MaybeQuotedPath(), ""),
"set user data directory (used for saves, screenshots, etc)"); "set user data directory (used for saves, screenshots, etc)");
} }

Loading…
Cancel
Save