From d430290e48b1d3a17df2ce4905e907b595bd752d Mon Sep 17 00:00:00 2001 From: ehofman Date: Tue, 30 Mar 2004 09:05:05 +0000 Subject: [PATCH] Frederic Bouvier: 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. --- src/Main/main.cxx | 10 +++++++--- src/Main/options.cxx | 8 ++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 8636e3b9d..e97a4cff5 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -1510,10 +1510,14 @@ bool fgMainInit( int argc, char **argv ) { 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); } diff --git a/src/Main/options.cxx b/src/Main/options.cxx index df0513a49..206b2a308 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -1762,8 +1762,12 @@ void fgShowAircraft(const SGPath &path, bool recursive) { 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 }