forked from teamnwah/openmw-tes3coop
added --version command line option
This commit is contained in:
parent
a7b266c4d2
commit
d9a25427c5
1 changed files with 16 additions and 2 deletions
|
@ -26,6 +26,8 @@
|
|||
|
||||
#endif
|
||||
|
||||
#include "config.hpp"
|
||||
|
||||
using namespace std;
|
||||
|
||||
/// Parse command line options and openmw.cfg file (if one exists). Results are directly
|
||||
|
@ -41,7 +43,8 @@ bool parseOptions (int argc, char**argv, OMW::Engine& engine)
|
|||
"Syntax: openmw <options>\nAllowed options");
|
||||
|
||||
desc.add_options()
|
||||
("help", "print help message")
|
||||
("help", "print help message and quit")
|
||||
("version", "print version information and quit")
|
||||
("data", bpo::value<std::vector<std::string> >()
|
||||
->default_value (std::vector<std::string>(), "data")
|
||||
->multitoken(),
|
||||
|
@ -105,12 +108,23 @@ bool parseOptions (int argc, char**argv, OMW::Engine& engine)
|
|||
if (globalConfigFile.is_open())
|
||||
bpo::store ( bpo::parse_config_file (globalConfigFile, desc), variables);
|
||||
|
||||
bool run = true;
|
||||
|
||||
if (variables.count ("help"))
|
||||
{
|
||||
std::cout << desc << std::endl;
|
||||
return false;
|
||||
run = false;
|
||||
}
|
||||
|
||||
if (variables.count ("version"))
|
||||
{
|
||||
std::cout << "OpenMW version " << OPENMW_VERSION << std::endl;
|
||||
run = false;
|
||||
}
|
||||
|
||||
if (!run)
|
||||
return false;
|
||||
|
||||
// directory settings
|
||||
if (variables["fs-strict"].as<bool>()==true)
|
||||
engine.enableFSStrict();
|
||||
|
|
Loading…
Reference in a new issue