Make FG_OPTIONS_EXIT work.
'fgfs --version' wants to exit...
This commit is contained in:
parent
194520b77e
commit
22c20a2f09
1 changed files with 10 additions and 3 deletions
|
@ -1998,9 +1998,16 @@ void Options::processOptions()
|
|||
OptionValueVec::const_iterator it;
|
||||
for (it = groupBegin; it != groupEnd; ++it) {
|
||||
int result = p->processOption(it->desc, it->value);
|
||||
if (result == FG_OPTIONS_ERROR) {
|
||||
showUsage();
|
||||
exit(-1);
|
||||
switch(result)
|
||||
{
|
||||
case FG_OPTIONS_ERROR:
|
||||
showUsage();
|
||||
exit(-1); // exit and return an error
|
||||
case FG_OPTIONS_EXIT:
|
||||
exit(0); // clean exit
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue