streamlined command line options

pull/21/head
Sebastian Wick 13 years ago
parent 329d59e52b
commit 329ba24eab

@ -9,7 +9,8 @@ namespace bpo = boost::program_options;
int main(int argc, char *argv[]) {
bpo::options_description desc("Syntax: mwiniimporter -i inifile -c configfile <options>\nAllowed options");
bpo::options_description desc("Syntax: mwiniimporter <options> inifile configfile\nAllowed options");
bpo::positional_options_description p_desc;
desc.add_options()
("help,h", "produce help message")
("verbose,v", "verbose output")
@ -18,9 +19,15 @@ int main(int argc, char *argv[]) {
("output,o", bpo::value<std::string>()->default_value(""), "openmw.cfg file")
("game-files,g", "import esm and esp files")
;
p_desc.add("ini", 1).add("cfg", 1);
bpo::variables_map vm;
bpo::store(boost::program_options::parse_command_line(argc, argv, desc), vm);
bpo::parsed_options parsed = bpo::command_line_parser(argc, argv)
.options(desc)
.positional(p_desc)
.run();
bpo::store(parsed, vm);
if(vm.count("help") || !vm.count("ini") || !vm.count("cfg")) {
std::cout << desc;

Loading…
Cancel
Save