trying the --show-aircraft option, I noticed that I had
no output. This is because there are still output to
cout or cerr, that are not triggering my console patch
for windows. The patch attached use SG_LOG instead.
A request to hit a key is also added because otherwise,
the console window will disappear as soon as the program
stop.
This problem is minor though given the fact that fgfs.exe
is shipped with fgrun that do show the available aircraft
in a much nicer manner.
if ( !(base_version == required_version) ) {
// tell the operator how to use this application
- cerr << endl << "Base package check failed ... " \
+ SG_LOG( SG_GENERAL, SG_ALERT, endl << "Base package check failed ... " \
<< "Found version " << base_version << " at: " \
- << globals->get_fg_root() << endl;
- cerr << "Please upgrade to version: " << required_version << endl;
+ << globals->get_fg_root() );
+ SG_LOG( SG_GENERAL, SG_ALERT, "Please upgrade to version: " << required_version );
+#ifdef _MSC_VER
+ SG_LOG( SG_GENERAL, SG_ALERT, "Hit a key to continue..." );
+ cin.get();
+#endif
exit(-1);
}
fgSearchAircraft( path, aircraft, recursive );
sort(aircraft.begin(), aircraft.end());
- cout << "Available aircraft:" << endl;
+ SG_LOG( SG_GENERAL, SG_ALERT, "Available aircraft:" );
for ( unsigned int i = 0; i < aircraft.size(); i++ ) {
- cout << aircraft[i] << endl;
+ SG_LOG( SG_GENERAL, SG_ALERT, aircraft[i] );
}
+#ifdef _MSC_VER
+ SG_LOG( SG_GENERAL, SG_ALERT, "Hit a key to continue..." );
+ cin.get();
+#endif
}