Ignore not-found 'config file' arguments.
Fixes confusing startup behaviour with malformed args, when an argument accidentally contains a space (e.g. a park-pos or protocol desc). In this case we treat the parts after the space as an XML config file name. When we can't find this file, we completely abandon options setup, which causes many downstream errors. Change the behaviour so we warn in this case, but carry on with normal startup.
This commit is contained in:
parent
19528fab8c
commit
ca3cc03fac
1 changed files with 2 additions and 8 deletions
|
@ -1842,10 +1842,9 @@ void Options::init(int argc, char **argv, const SGPath& appDataPath)
|
|||
SGPath f(argv[i]);
|
||||
if (!f.exists()) {
|
||||
SG_LOG(SG_GENERAL, SG_ALERT, "config file not found:" << f.str());
|
||||
return;
|
||||
} else {
|
||||
p->propertyFiles.push_back(f);
|
||||
}
|
||||
|
||||
p->propertyFiles.push_back(f);
|
||||
}
|
||||
} // of arguments iteration
|
||||
p->insertGroupMarker(); // command line is one group
|
||||
|
@ -2170,11 +2169,6 @@ OptionResult Options::processOptions()
|
|||
}
|
||||
|
||||
BOOST_FOREACH(const SGPath& file, p->propertyFiles) {
|
||||
if (!file.exists()) {
|
||||
SG_LOG(SG_GENERAL, SG_ALERT, "config file not found:" << file.str());
|
||||
continue;
|
||||
}
|
||||
|
||||
SG_LOG(SG_GENERAL, SG_INFO,
|
||||
"Reading command-line property file " << file.str());
|
||||
readProperties(file.str(), globals->get_props());
|
||||
|
|
Loading…
Add table
Reference in a new issue