]> git.mxchange.org Git - flightgear.git/blob - src/Main/options.cxx
93fff76a3692489e65ebfa0721933f0004819b43
[flightgear.git] / src / Main / options.cxx
1 // options.cxx -- class to handle command line options
2 //
3 // Written by Curtis Olson, started April 1998.
4 //
5 // Copyright (C) 1998  Curtis L. Olson  - curt@me.umn.edu
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 //
21 // $Id$
22
23
24 #ifdef HAVE_CONFIG_H
25 #  include <config.h>
26 #endif
27
28 #include <simgear/compiler.h>
29
30 /* normans fix */
31 #if defined(FX) && defined(XMESA)
32 bool global_fullscreen = true;
33 #endif
34
35 #include <math.h>            // rint()
36 #include <stdio.h>
37 #include <stdlib.h>          // atof(), atoi()
38 #include <string.h>
39
40 #include STL_STRING
41
42 #include <simgear/misc/sgstream.hxx>
43
44 // #include <Include/general.hxx>
45 // #include <Airports/simple.hxx>
46 // #include <Cockpit/cockpit.hxx>
47 // #include <FDM/flight.hxx>
48 // #include <FDM/UIUCModel/uiuc_aircraftdir.h>
49 #ifdef FG_NETWORK_OLK
50 #  include <NetworkOLK/network.h>
51 #endif
52
53 #include "globals.hxx"
54 #include "fg_init.hxx"
55 #include "fg_props.hxx"
56 #include "options.hxx"
57
58 SG_USING_STD(string);
59 SG_USING_NAMESPACE(std);
60
61
62 #define NEW_DEFAULT_MODEL_HZ 120
63
64 enum
65 {
66     FG_OPTIONS_OK = 0,
67     FG_OPTIONS_HELP = 1,
68     FG_OPTIONS_ERROR = 2
69 };
70
71 static double
72 atof( const string& str )
73 {
74
75 #ifdef __MWERKS__ 
76     // -dw- if ::atof is called, then we get an infinite loop
77     return std::atof( str.c_str() );
78 #else
79     return ::atof( str.c_str() );
80 #endif
81 }
82
83 static int
84 atoi( const string& str )
85 {
86 #ifdef __MWERKS__ 
87     // -dw- if ::atoi is called, then we get an infinite loop
88     return std::atoi( str.c_str() );
89 #else
90     return ::atoi( str.c_str() );
91 #endif
92 }
93
94
95 /**
96  * Set a few fail-safe default property values.
97  *
98  * These should all be set in $FG_ROOT/preferences.xml, but just
99  * in case, we provide some initial sane values here. This method 
100  * should be invoked *before* reading any init files.
101  */
102 void
103 fgSetDefaults ()
104 {
105     // set a possibly independent location for scenery data
106     char *envp = ::getenv( "FG_SCENERY" );
107
108     if ( envp != NULL ) {
109         // fg_root could be anywhere, so default to environmental
110         // variable $FG_ROOT if it is set.
111         globals->set_fg_scenery(envp);
112     } else {
113         // Otherwise, default to Scenery being in $FG_ROOT/Scenery
114         globals->set_fg_scenery("");
115     }
116                                 // Position (Globe, AZ)
117     fgSetDouble("/position/longitude-deg", -110.6642444);
118     fgSetDouble("/position/latitude-deg", 33.3528917);
119     fgSetDouble("/position/altitude-ft", -9999.0);
120
121                                 // Orientation
122     fgSetDouble("/orientation/heading-deg", 270);
123     fgSetDouble("/orientation/roll-deg", 0);
124     fgSetDouble("/orientation/pitch-deg", 0.424);
125
126                                 // Velocities
127     fgSetString("/sim/startup/speed-set", "knots");
128     fgSetDouble("/velocities/uBody-fps", 0.0);
129     fgSetDouble("/velocities/vBody-fps", 0.0);
130     fgSetDouble("/velocities/wBody-fps", 0.0);
131     fgSetDouble("/velocities/speed-north-fps", 0.0);
132     fgSetDouble("/velocities/speed-east-fps", 0.0);
133     fgSetDouble("/velocities/speed-down-fps", 0.0);
134     fgSetDouble("/velocities/airspeed-kt", 0.0);
135     fgSetDouble("/velocities/mach", 0.0);
136
137                                 // Miscellaneous
138     fgSetBool("/sim/startup/game-mode", false);
139     fgSetBool("/sim/startup/splash-screen", true);
140     fgSetBool("/sim/startup/intro-music", true);
141     // we want mouse-pointer to have an undefined value if nothing is
142     // specified so we can do the right thing for voodoo-1/2 cards.
143     // fgSetString("/sim/startup/mouse-pointer", "disabled");
144     fgSetString("/sim/control-mode", "joystick");
145     fgSetBool("/sim/auto-coordination", false);
146 #if !defined(WIN32)
147     fgSetString("/sim/startup/browser-app", "netscape");
148 #else
149     fgSetString("/sim/startup/browser-app", "webrun.bat");
150 #endif
151                                 // Features
152     fgSetBool("/sim/hud/visibility", false);
153     fgSetBool("/sim/panel/visibility", true);
154     fgSetBool("/sim/sound", true);
155     fgSetBool("/sim/hud/antialiased", false);
156
157                                 // Flight Model options
158     fgSetString("/sim/flight-model", "larcsim");
159     fgSetString("/sim/aircraft", "c172");
160     fgSetInt("/sim/model-hz", NEW_DEFAULT_MODEL_HZ);
161     fgSetInt("/sim/speed-up", 1);
162     fgSetBool("/sim/startup/trim", false);
163     fgSetBool("/sim/startup/onground", true);
164
165                                 // Rendering options
166     fgSetString("/sim/rendering/fog", "nicest");
167     fgSetBool("/environment/clouds/status", true);
168     fgSetDouble("/environment/clouds/altitude-ft", 5000);
169     fgSetBool("/sim/startup/fullscreen", false);
170     fgSetBool("/sim/rendering/shading", true);
171     fgSetBool("/sim/rendering/skyblend", true);
172     fgSetBool("/sim/rendering/textures", true);
173     fgSetBool("/sim/rendering/wireframe", false);
174     fgSetInt("/sim/startup/xsize", 800);
175     fgSetInt("/sim/startup/ysize", 600);
176     fgSetInt("/sim/rendering/bits-per-pixel", 16);
177     fgSetString("/sim/view-mode", "pilot");
178     fgSetDouble("/sim/view/offset-deg", 0);
179     fgSetDouble("/environment/visibility-m", 20000);
180
181                                 // HUD options
182     fgSetString("/sim/startup/units", "feet");
183     fgSetString("/sim/hud/frame-stat-type", "tris");
184         
185                                 // Time options
186     fgSetInt("/sim/startup/time-offset", 0);
187     fgSetString("/sim/startup/time-offset-type", "system-offset");
188
189     fgSetBool("/sim/networking/network-olk", false);
190     fgSetString("/sim/networking/call-sign", "Johnny");
191 }
192
193
194 // parse a time string ([+/-]%f[:%f[:%f]]) into hours
195 static double
196 parse_time(const string& time_in) {
197     char *time_str, num[256];
198     double hours, minutes, seconds;
199     double result = 0.0;
200     int sign = 1;
201     int i;
202
203     time_str = (char *)time_in.c_str();
204
205     // printf("parse_time(): %s\n", time_str);
206
207     // check for sign
208     if ( strlen(time_str) ) {
209         if ( time_str[0] == '+' ) {
210             sign = 1;
211             time_str++;
212         } else if ( time_str[0] == '-' ) {
213             sign = -1;
214             time_str++;
215         }
216     }
217     // printf("sign = %d\n", sign);
218
219     // get hours
220     if ( strlen(time_str) ) {
221         i = 0;
222         while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
223             num[i] = time_str[0];
224             time_str++;
225             i++;
226         }
227         if ( time_str[0] == ':' ) {
228             time_str++;
229         }
230         num[i] = '\0';
231         hours = atof(num);
232         // printf("hours = %.2lf\n", hours);
233
234         result += hours;
235     }
236
237     // get minutes
238     if ( strlen(time_str) ) {
239         i = 0;
240         while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
241             num[i] = time_str[0];
242             time_str++;
243             i++;
244         }
245         if ( time_str[0] == ':' ) {
246             time_str++;
247         }
248         num[i] = '\0';
249         minutes = atof(num);
250         // printf("minutes = %.2lf\n", minutes);
251
252         result += minutes / 60.0;
253     }
254
255     // get seconds
256     if ( strlen(time_str) ) {
257         i = 0;
258         while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
259             num[i] = time_str[0];
260             time_str++;
261             i++;
262         }
263         num[i] = '\0';
264         seconds = atof(num);
265         // printf("seconds = %.2lf\n", seconds);
266
267         result += seconds / 3600.0;
268     }
269
270     return(sign * result);
271 }
272
273
274 // parse a date string (yyyy:mm:dd:hh:mm:ss) into a time_t (seconds)
275 static long int 
276 parse_date( const string& date)
277 {
278     struct tm gmt;
279     char * date_str, num[256];
280     int i;
281     // initialize to zero
282     gmt.tm_sec = 0;
283     gmt.tm_min = 0;
284     gmt.tm_hour = 0;
285     gmt.tm_mday = 0;
286     gmt.tm_mon = 0;
287     gmt.tm_year = 0;
288     gmt.tm_isdst = 0; // ignore daylight savings time for the moment
289     date_str = (char *)date.c_str();
290     // get year
291     if ( strlen(date_str) ) {
292         i = 0;
293         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
294             num[i] = date_str[0];
295             date_str++;
296             i++;
297         }
298         if ( date_str[0] == ':' ) {
299             date_str++;
300         }
301         num[i] = '\0';
302         gmt.tm_year = atoi(num) - 1900;
303     }
304     // get month
305     if ( strlen(date_str) ) {
306         i = 0;
307         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
308             num[i] = date_str[0];
309             date_str++;
310             i++;
311         }
312         if ( date_str[0] == ':' ) {
313             date_str++;
314         }
315         num[i] = '\0';
316         gmt.tm_mon = atoi(num) -1;
317     }
318     // get day
319     if ( strlen(date_str) ) {
320         i = 0;
321         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
322             num[i] = date_str[0];
323             date_str++;
324             i++;
325         }
326         if ( date_str[0] == ':' ) {
327             date_str++;
328         }
329         num[i] = '\0';
330         gmt.tm_mday = atoi(num);
331     }
332     // get hour
333     if ( strlen(date_str) ) {
334         i = 0;
335         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
336             num[i] = date_str[0];
337             date_str++;
338             i++;
339         }
340         if ( date_str[0] == ':' ) {
341             date_str++;
342         }
343         num[i] = '\0';
344         gmt.tm_hour = atoi(num);
345     }
346     // get minute
347     if ( strlen(date_str) ) {
348         i = 0;
349         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
350             num[i] = date_str[0];
351             date_str++;
352             i++;
353         }
354         if ( date_str[0] == ':' ) {
355             date_str++;
356         }
357         num[i] = '\0';
358         gmt.tm_min = atoi(num);
359     }
360     // get second
361     if ( strlen(date_str) ) {
362         i = 0;
363         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
364             num[i] = date_str[0];
365             date_str++;
366             i++;
367         }
368         if ( date_str[0] == ':' ) {
369             date_str++;
370         }
371         num[i] = '\0';
372         gmt.tm_sec = atoi(num);
373     }
374     time_t theTime = sgTimeGetGMT( gmt.tm_year, gmt.tm_mon, gmt.tm_mday,
375                                    gmt.tm_hour, gmt.tm_min, gmt.tm_sec );
376     //printf ("Date is %s\n", ctime(&theTime));
377     //printf ("in seconds that is %d\n", theTime);
378     //exit(1);
379     return (theTime);
380 }
381
382
383 // parse angle in the form of [+/-]ddd:mm:ss into degrees
384 static double
385 parse_degree( const string& degree_str) {
386     double result = parse_time( degree_str );
387
388     // printf("Degree = %.4f\n", result);
389
390     return(result);
391 }
392
393
394 // parse time offset string into seconds
395 static int
396 parse_time_offset( const string& time_str) {
397     int result;
398
399     // printf("time offset = %s\n", time_str);
400
401 #ifdef HAVE_RINT
402     result = (int)rint(parse_time(time_str) * 3600.0);
403 #else
404     result = (int)(parse_time(time_str) * 3600.0);
405 #endif
406
407     // printf("parse_time_offset(): %d\n", result);
408
409     return( result );
410 }
411
412
413 // Parse --fov=x.xx type option 
414 static double
415 parse_fov( const string& arg ) {
416     double fov = atof(arg);
417
418     if ( fov < FG_FOV_MIN ) { fov = FG_FOV_MIN; }
419     if ( fov > FG_FOV_MAX ) { fov = FG_FOV_MAX; }
420
421     fgSetDouble("/sim/field-of-view", fov);
422
423     // printf("parse_fov(): result = %.4f\n", fov);
424
425     return fov;
426 }
427
428
429 // Parse I/O channel option
430 //
431 // Format is "--protocol=medium,direction,hz,medium_options,..."
432 //
433 //   protocol = { native, nmea, garmin, fgfs, rul, pve, etc. }
434 //   medium = { serial, socket, file, etc. }
435 //   direction = { in, out, bi }
436 //   hz = number of times to process channel per second (floating
437 //        point values are ok.
438 //
439 // Serial example "--nmea=serial,dir,hz,device,baud" where
440 // 
441 //  device = OS device name of serial line to be open()'ed
442 //  baud = {300, 1200, 2400, ..., 230400}
443 //
444 // Socket exacmple "--native=socket,dir,hz,machine,port,style" where
445 // 
446 //  machine = machine name or ip address if client (leave empty if server)
447 //  port = port, leave empty to let system choose
448 //  style = tcp or udp
449 //
450 // File example "--garmin=file,dir,hz,filename" where
451 // 
452 //  filename = file system file name
453
454 static bool 
455 parse_channel( const string& type, const string& channel_str ) {
456     // cout << "Channel string = " << channel_str << endl;
457
458     globals->get_channel_options_list()->push_back( type + "," + channel_str );
459
460     return true;
461 }
462
463
464 // Parse --wp=ID[@alt]
465 static bool 
466 parse_wp( const string& arg ) {
467     string id, alt_str;
468     double alt = 0.0;
469
470     unsigned int pos = arg.find( "@" );
471     if ( pos != string::npos ) {
472         id = arg.substr( 0, pos );
473         alt_str = arg.substr( pos + 1 );
474         // cout << "id str = " << id << "  alt str = " << alt_str << endl;
475         alt = atof( alt_str.c_str() );
476         if ( fgGetString("/sim/startup/units") == "feet" ) {
477             alt *= SG_FEET_TO_METER;
478         }
479     } else {
480         id = arg;
481     }
482
483     FGAirport a;
484     if ( fgFindAirportID( id, &a ) ) {
485         SGWayPoint wp( a.longitude, a.latitude, alt, SGWayPoint::WGS84, id );
486         globals->get_route()->add_waypoint( wp );
487
488         return true;
489     } else {
490         return false;
491     }
492 }
493
494
495 // Parse --flight-plan=[file]
496 static bool 
497 parse_flightplan(const string& arg)
498 {
499     sg_gzifstream in(arg.c_str());
500     if ( !in.is_open() ) {
501         return false;
502     }
503     while ( true ) {
504         string line;
505
506 #if defined( macintosh )
507         getline( in, line, '\r' );
508 #else
509         getline( in, line, '\n' );
510 #endif
511
512         // catch extraneous (DOS) line ending character
513         if ( line[line.length() - 1] < 32 ) {
514             line = line.substr( 0, line.length()-1 );
515         }
516
517         if ( in.eof() ) {
518             break;
519         }
520         parse_wp(line);
521     }
522
523     return true;
524 }
525
526
527 // Parse a single option
528 static int 
529 parse_option (const string& arg) 
530 {
531     // General Options
532     if ( (arg == "--help") || (arg == "-h") ) {
533         // help/usage request
534         return(FG_OPTIONS_HELP);
535     } else if ( arg == "--disable-game-mode") {
536         fgSetBool("/sim/startup/game-mode", false);
537     } else if ( arg == "--enable-game-mode" ) {
538         fgSetBool("/sim/startup/game-mode", true);
539     } else if ( arg == "--disable-splash-screen" ) {
540         fgSetBool("/sim/startup/splash-screen", false); 
541     } else if ( arg == "--enable-splash-screen" ) {
542         fgSetBool("/sim/startup/splash-screen", true);
543     } else if ( arg == "--disable-intro-music" ) {
544         fgSetBool("/sim/startup/intro-music", false);
545     } else if ( arg == "--enable-intro-music" ) {
546         fgSetBool("/sim/startup/intro-music", true);
547     } else if ( arg == "--disable-mouse-pointer" ) {
548         fgSetString("/sim/startup/mouse-pointer", "disabled");
549     } else if ( arg == "--enable-mouse-pointer" ) {
550         fgSetString("/sim/startup/mouse-pointer", "enabled");
551     } else if ( arg == "--disable-freeze" ) {
552         fgSetBool("/sim/freeze", false);
553     } else if ( arg == "--enable-freeze" ) {
554         fgSetBool("/sim/freeze", true);
555     } else if ( arg == "--disable-anti-alias-hud" ) {
556         fgSetBool("/sim/hud/antialiased", false);
557     } else if ( arg == "--enable-anti-alias-hud" ) {
558         fgSetBool("/sim/hud/antialiased", true);
559     } else if ( arg.find( "--control=") == 0 ) {
560         fgSetString("/sim/control-mode", arg.substr(10));
561     } else if ( arg == "--disable-auto-coordination" ) {
562         fgSetBool("/sim/auto-coordination", false);
563     } else if ( arg == "--enable-auto-coordination" ) {
564         fgSetBool("/sim/auto-coordination", true);
565     } else if ( arg.find( "--browser-app=") == 0 ) {
566         fgSetString("/sim/startup/browser-app", arg.substr(14));
567     } else if ( arg == "--disable-hud" ) {
568         fgSetBool("/sim/hud/visibility", false);
569     } else if ( arg == "--enable-hud" ) {
570         fgSetBool("/sim/hud/visibility", true);
571     } else if ( arg == "--disable-panel" ) {
572         fgSetBool("/sim/panel/visibility", false);
573     } else if ( arg == "--enable-panel" ) {
574         fgSetBool("/sim/panel/visibility", true);
575     } else if ( arg == "--disable-sound" ) {
576         fgSetBool("/sim/sound", false);
577     } else if ( arg == "--enable-sound" ) {
578         fgSetBool("/sim/sound", true);
579     } else if ( arg.find( "--airport-id=") == 0 ) {
580                                 // NB: changed property name!!!
581         fgSetString("/sim/startup/airport-id", arg.substr(13));
582     } else if ( arg.find( "--offset-distance=") == 0 ) {
583         fgSetDouble("/sim/startup/offset-distance", atof(arg.substr(18)));
584     } else if ( arg.find( "--offset-azimuth=") == 0 ) {
585         fgSetDouble("/sim/startup/offset-azimuth", atof(arg.substr(17))); 
586     } else if ( arg.find( "--lon=" ) == 0 ) {
587         fgSetDouble("/position/longitude-deg",
588                               parse_degree(arg.substr(6)));
589         fgSetString("/sim/startup/airport-id", "");
590     } else if ( arg.find( "--lat=" ) == 0 ) {
591         fgSetDouble("/position/latitude-deg",
592                               parse_degree(arg.substr(6)));
593         fgSetString("/sim/startup/airport-id", "");
594     } else if ( arg.find( "--altitude=" ) == 0 ) {
595         fgSetBool("/sim/startup/onground", false);
596         if ( fgGetString("/sim/startup/units") == "feet" )
597             fgSetDouble("/position/altitude-ft", atof(arg.substr(11)));
598         else
599             fgSetDouble("/position/altitude-ft",
600                         atof(arg.substr(11)) * SG_METER_TO_FEET);
601     } else if ( arg.find( "--uBody=" ) == 0 ) {
602         fgSetString("/sim/startup/speed-set", "UVW");
603         if ( fgGetString("/sim/startup/units") == "feet" )
604           fgSetDouble("/velocities/uBody-fps", atof(arg.substr(8)));
605         else
606           fgSetDouble("/velocities/uBody-fps",
607                                atof(arg.substr(8)) * SG_METER_TO_FEET);
608     } else if ( arg.find( "--vBody=" ) == 0 ) {
609         fgSetString("/sim/startup/speed-set", "UVW");
610         if ( fgGetString("/sim/startup/units") == "feet" )
611           fgSetDouble("/velocities/vBody-fps", atof(arg.substr(8)));
612         else
613           fgSetDouble("/velocities/vBody-fps",
614                                atof(arg.substr(8)) * SG_METER_TO_FEET);
615     } else if ( arg.find( "--wBody=" ) == 0 ) {
616         fgSetString("/sim/startup/speed-set", "UVW");
617         if ( fgGetString("/sim/startup/units") == "feet" )
618           fgSetDouble("/velocities/wBody-fps", atof(arg.substr(8)));
619         else
620           fgSetDouble("/velocities/wBody-fps",
621                                atof(arg.substr(8)) * SG_METER_TO_FEET);
622     } else if ( arg.find( "--vNorth=" ) == 0 ) {
623         fgSetString("/sim/startup/speed-set", "NED");
624         if ( fgGetString("/sim/startup/units") == "feet" )
625           fgSetDouble("/velocities/speed-north-fps", atof(arg.substr(9)));
626         else
627           fgSetDouble("/velocities/speed-north-fps",
628                                atof(arg.substr(9)) * SG_METER_TO_FEET);
629     } else if ( arg.find( "--vEast=" ) == 0 ) {
630         fgSetString("/sim/startup/speed-set", "NED");
631         if ( fgGetString("/sim/startup/units") == "feet" )
632           fgSetDouble("/velocities/speed-east-fps", atof(arg.substr(8)));
633         else
634           fgSetDouble("/velocities/speed-east-fps",
635                       atof(arg.substr(8)) * SG_METER_TO_FEET);
636     } else if ( arg.find( "--vDown=" ) == 0 ) {
637         fgSetString("/sim/startup/speed-set", "NED");
638         if ( fgGetString("/sim/startup/units") == "feet" )
639           fgSetDouble("/velocities/speed-down-fps", atof(arg.substr(8)));
640         else
641           fgSetDouble("/velocities/speed-down-fps",
642                                atof(arg.substr(8)) * SG_METER_TO_FEET);
643     } else if ( arg.find( "--vc=" ) == 0) {
644         fgSetString("/sim/startup/speed-set", "knots");
645         fgSetDouble("/velocities/airspeed-kt", atof(arg.substr(5)));
646     } else if ( arg.find( "--mach=" ) == 0) {
647         fgSetString("/sim/startup/speed-set", "mach");
648         fgSetDouble("/velocities/mach", atof(arg.substr(7)));
649     } else if ( arg.find( "--heading=" ) == 0 ) {
650         fgSetDouble("/orientation/heading-deg", atof(arg.substr(10)));
651     } else if ( arg.find( "--roll=" ) == 0 ) {
652         fgSetDouble("/orientation/roll-deg", atof(arg.substr(7)));
653     } else if ( arg.find( "--pitch=" ) == 0 ) {
654         fgSetDouble("/orientation/pitch-deg", atof(arg.substr(8)));
655     } else if ( arg.find( "--fg-root=" ) == 0 ) {
656         globals->set_fg_root(arg.substr( 10 ));
657     } else if ( arg.find( "--fg-scenery=" ) == 0 ) {
658         globals->set_fg_scenery(arg.substr( 13 ));
659     } else if ( arg.find( "--fdm=" ) == 0 ) {
660         fgSetString("/sim/flight-model", arg.substr(6));
661     } else if ( arg.find( "--aircraft=" ) == 0 ) {
662         fgSetString("/sim/aircraft", arg.substr(11));
663     } else if ( arg.find( "--aircraft-dir=" ) == 0 ) {
664         fgSetString("/sim/aircraft-dir", arg.substr(15));
665     } else if ( arg.find( "--model-hz=" ) == 0 ) {
666         fgSetInt("/sim/model-hz", atoi(arg.substr(11)));
667     } else if ( arg.find( "--speed=" ) == 0 ) {
668         fgSetInt("/sim/speed-up", atoi(arg.substr(8)));
669     } else if ( arg.find( "--trim") == 0) {
670         fgSetBool("/sim/startup/trim", true);
671     } else if ( arg.find( "--notrim") == 0) {
672         fgSetBool("/sim/startup/trim", false);
673     } else if ( arg.find( "--on-ground") == 0) {
674         fgSetBool("/sim/startup/onground", true);
675     } else if ( arg.find( "--in-air") == 0) {
676         fgSetBool("/sim/startup/onground", false);
677     } else if ( arg == "--fog-disable" ) {
678         fgSetString("/sim/rendering/fog", "disabled");
679     } else if ( arg == "--fog-fastest" ) {
680         fgSetString("/sim/rendering/fog", "fastest");
681     } else if ( arg == "--fog-nicest" ) {
682         fgSetString("/sim/fog", "nicest");
683     } else if ( arg == "--disable-clouds" ) {
684         fgSetBool("/environment/clouds/status", false);
685     } else if ( arg == "--enable-clouds" ) {
686         fgSetBool("/environment/clouds/status", true);
687     } else if ( arg.find( "--clouds-asl=" ) == 0 ) {
688                                 // FIXME: check units
689         if ( fgGetString("/sim/startup/units") == "feet" )
690           fgSetDouble("/environment/clouds/altitude-ft",
691                                 atof(arg.substr(13)) * SG_FEET_TO_METER);
692         else
693           fgSetDouble("/environment/clouds/altitude-ft",
694                                 atof(arg.substr(13)));
695     } else if ( arg.find( "--fov=" ) == 0 ) {
696         parse_fov( arg.substr(6) );
697     } else if ( arg == "--disable-fullscreen" ) {
698         fgSetBool("/sim/startup/fullscreen", false);
699     } else if ( arg== "--enable-fullscreen") {
700         fgSetBool("/sim/startup/fullscreen", true);
701     } else if ( arg == "--shading-flat") {
702         fgSetBool("/sim/rendering/shading", false);
703     } else if ( arg == "--shading-smooth") {
704         fgSetBool("/sim/rendering/shading", true);
705     } else if ( arg == "--disable-skyblend") {
706         fgSetBool("/sim/rendering/skyblend", false);
707     } else if ( arg== "--enable-skyblend" ) {
708         fgSetBool("/sim/rendering/skyblend", true);
709     } else if ( arg == "--disable-textures" ) {
710         fgSetBool("/sim/rendering/textures", false);
711     } else if ( arg == "--enable-textures" ) {
712         fgSetBool("/sim/rendering/textures", true);
713     } else if ( arg == "--disable-wireframe" ) {
714         fgSetBool("/sim/rendering/wireframe", false);
715     } else if ( arg == "--enable-wireframe" ) {
716         fgSetBool("/sim/rendering/wireframe", true);
717     } else if ( arg.find( "--geometry=" ) == 0 ) {
718         bool geometry_ok = true;
719         int xsize = 0, ysize = 0;
720         string geometry = arg.substr( 11 );
721         string::size_type i = geometry.find('x');
722
723         if (i != string::npos) {
724             xsize = atoi(geometry.substr(0, i));
725             ysize = atoi(geometry.substr(i+1));
726         } else {
727             geometry_ok = false;
728         }
729
730         if ( xsize <= 0 || ysize <= 0 ) {
731             xsize = 640;
732             ysize = 480;
733             geometry_ok = false;
734         }
735
736         if ( !geometry_ok ) {
737             SG_LOG( SG_GENERAL, SG_ALERT, "Unknown geometry: " << geometry );
738             SG_LOG( SG_GENERAL, SG_ALERT,
739                     "Setting geometry to " << xsize << 'x' << ysize << '\n');
740         } else {
741           SG_LOG( SG_GENERAL, SG_INFO,
742                   "Setting geometry to " << xsize << 'x' << ysize << '\n');
743           fgSetInt("/sim/startup/xsize", xsize);
744           fgSetInt("/sim/startup/ysize", ysize);
745         }
746     } else if ( arg.find( "--bpp=" ) == 0 ) {
747         string bits_per_pix = arg.substr( 6 );
748         if ( bits_per_pix == "16" ) {
749             fgSetInt("/sim/rendering/bits-per-pixel", 16);
750         } else if ( bits_per_pix == "24" ) {
751             fgSetInt("/sim/rendering/bits-per-pixel", 24);
752         } else if ( bits_per_pix == "32" ) {
753             fgSetInt("/sim/rendering/bits-per-pixel", 32);
754         } else {
755           SG_LOG(SG_GENERAL, SG_ALERT, "Unsupported bpp " << bits_per_pix);
756         }
757     } else if ( arg == "--units-feet" ) {
758         fgSetString("/sim/startup/units", "feet");
759     } else if ( arg == "--units-meters" ) {
760         fgSetString("/sim/startup/units", "meters");
761     } else if ( arg.find( "--time-offset" ) == 0 ) {
762         fgSetInt("/sim/startup/time-offset",
763                            parse_time_offset( (arg.substr(14)) ));
764     } else if ( arg.find( "--time-match-real") == 0 ) {
765         fgSetString("/sim/startup/time-offset-type",
766                               "system-offset");
767     } else if ( arg.find( "--time-match-local") == 0 ) {
768         fgSetString("/sim/startup/time-offset-type",
769                               "latitude-offset");
770     } else if ( arg.find( "--start-date-sys=") == 0 ) {
771         fgSetInt("/sim/startup/time-offset",
772                            parse_date((arg.substr(17))));
773         fgSetString("/sim/startup/time-offset-type", "system");
774     } else if ( arg.find( "--start-date-lat=") == 0 ) {
775         fgSetInt("/sim/startup/time-offset",
776                            parse_date((arg.substr(17))));
777         fgSetString("/sim/startup/time-offset-type",
778                            "latitude");
779     } else if ( arg.find( "--start-date-gmt=") == 0 ) {
780         fgSetInt("/sim/startup/time-offset",
781                            parse_date((arg.substr(17))));
782         fgSetString("/sim/startup/time-offset-type", "gmt");
783     } else if ( arg == "--hud-tris" ) {
784         fgSetString("/sim/hud/frame-stat-type", "tris");
785     } else if ( arg == "--hud-culled" ) {
786         fgSetString("/sim/hud/frame-stat-type", "culled");
787     } else if ( arg.find( "--atlas=" ) == 0 ) {
788         parse_channel( "atlas", arg.substr(8) );
789     } else if ( arg.find( "--native=" ) == 0 ) {
790         parse_channel( "native", arg.substr(9) );
791     } else if ( arg.find( "--garmin=" ) == 0 ) {
792         parse_channel( "garmin", arg.substr(9) );
793     } else if ( arg.find( "--nmea=" ) == 0 ) {
794         parse_channel( "nmea", arg.substr(7) );
795     } else if ( arg.find( "--props=" ) == 0 ) {
796         parse_channel( "props", arg.substr(8) );
797     } else if ( arg.find( "--pve=" ) == 0 ) {
798         parse_channel( "pve", arg.substr(6) );
799     } else if ( arg.find( "--ray=" ) == 0 ) {
800         parse_channel( "ray", arg.substr(6) );
801     } else if ( arg.find( "--rul=" ) == 0 ) {
802         parse_channel( "rul", arg.substr(6) );
803     } else if ( arg.find( "--joyclient=" ) == 0 ) {
804         parse_channel( "joyclient", arg.substr(12) );
805 #ifdef FG_NETWORK_OLK
806     } else if ( arg == "--disable-network-olk" ) {
807         fgSetBool("/sim/networking/olk", false);
808     } else if ( arg== "--enable-network-olk") {
809         fgSetBool("/sim/networking/olk", true);
810     } else if ( arg == "--net-hud" ) {
811         fgSetBool("/sim/hud/net-display", true);
812         net_hud_display = 1;    // FIXME
813     } else if ( arg.find( "--net-id=") == 0 ) {
814         fgSetString("sim/networking/call-sign", arg.substr(9));
815 #endif
816     } else if ( arg.find( "--prop:" ) == 0 ) {
817         string assign = arg.substr(7);
818         unsigned int pos = assign.find('=');
819         if ( pos == arg.npos || pos == 0 ) {
820             SG_LOG( SG_GENERAL, SG_ALERT, "Bad property assignment: " << arg );
821             return FG_OPTIONS_ERROR;
822         }
823         string name = assign.substr(0, pos);
824         string value = assign.substr(pos + 1);
825         fgSetString(name.c_str(), value);
826         // SG_LOG(SG_GENERAL, SG_INFO, "Setting default value of property "
827         //        << name << " to \"" << value << '"');
828     // $$$ begin - added VS Renganathan, 14 Oct 2K
829     // for multi-window outside window imagery
830     } else if ( arg.find( "--view-offset=" ) == 0 ) {
831         string woffset = arg.substr( 14 );
832         double default_view_offset = 0.0;
833         if ( woffset == "LEFT" ) {
834                default_view_offset = SGD_PI * 0.25;
835         } else if ( woffset == "RIGHT" ) {
836             default_view_offset = SGD_PI * 1.75;
837         } else if ( woffset == "CENTER" ) {
838             default_view_offset = 0.00;
839         } else {
840             default_view_offset = atof( woffset.c_str() ) * SGD_DEGREES_TO_RADIANS;
841         }
842         FGViewerRPH *pilot_view =
843             (FGViewerRPH *)globals->get_viewmgr()->get_view( 0 );
844         pilot_view->set_view_offset( default_view_offset );
845         pilot_view->set_goal_view_offset( default_view_offset );
846         fgSetDouble("/sim/view/offset-deg", default_view_offset);
847     // $$$ end - added VS Renganathan, 14 Oct 2K
848     } else if ( arg.find( "--visibility=" ) == 0 ) {
849         fgSetDouble("/environment/visibility-m", atof(arg.substr(13)));
850     } else if ( arg.find( "--visibility-miles=" ) == 0 ) {
851         double visibility = atof(arg.substr(19)) * 5280.0 * SG_FEET_TO_METER;
852         fgSetDouble("/environment/visibility-m", visibility);
853     } else if ( arg.find( "--wind=" ) == 0 ) {
854         string val = arg.substr(7);
855         unsigned int pos = val.find('@');
856         if ( pos == string::npos ) {
857           SG_LOG( SG_GENERAL, SG_ALERT, "bad wind value " << val );
858           return FG_OPTIONS_ERROR;
859         }
860         double dir = atof(val.substr(0,pos).c_str());
861         double speed = atof(val.substr(pos+1).c_str());
862         SG_LOG(SG_GENERAL, SG_INFO, "WIND: " << dir << '@' << 
863                speed << " knots" << endl);
864                                 // convert to fps
865         speed *= SG_NM_TO_METER * SG_METER_TO_FEET * (1.0/3600);
866         dir += 180;
867         if (dir >= 360)
868           dir -= 360;
869         dir *= SGD_DEGREES_TO_RADIANS;
870         fgSetDouble("/environment/wind-north-fps",
871                                              speed * cos(dir));
872         fgSetDouble("/environment/wind-east-fps",
873                                              speed * sin(dir));
874     } else if ( arg.find( "--wp=" ) == 0 ) {
875         parse_wp( arg.substr( 5 ) );
876     } else if ( arg.find( "--flight-plan=") == 0) {
877         parse_flightplan ( arg.substr (14) );
878     } else if ( arg.find( "--config=" ) == 0 ) {
879         string file = arg.substr(9);
880         if (!readProperties(file, globals->get_props())) {
881           SG_LOG(SG_IO, SG_ALERT,
882                  "--config: failed to read properties from " << file);
883           return FG_OPTIONS_ERROR;
884         }
885     } else {
886         SG_LOG( SG_GENERAL, SG_ALERT, "Unknown option '" << arg << "'" );
887         return FG_OPTIONS_ERROR;
888     }
889     
890     return FG_OPTIONS_OK;
891 }
892
893
894 // Scan the command line options for an fg_root definition and set
895 // just that.
896 string
897 fgScanForRoot (int argc, char **argv) 
898 {
899     int i = 1;
900
901     SG_LOG(SG_GENERAL, SG_INFO, "Scanning for root: command line");
902
903     while ( i < argc ) {
904         SG_LOG( SG_GENERAL, SG_DEBUG, "argv[" << i << "] = " << argv[i] );
905
906         string arg = argv[i];
907         if ( arg.find( "--fg-root=" ) == 0 ) {
908             return arg.substr( 10 );
909         }
910
911         i++;
912     }
913
914     return "";
915 }
916
917
918 // Scan the config file for an fg_root definition and set just that.
919 string
920 fgScanForRoot (const string& path)
921 {
922     sg_gzifstream in( path );
923     if ( !in.is_open() )
924       return "";
925
926     SG_LOG( SG_GENERAL, SG_INFO, "Scanning for root: " << path );
927
928     in >> skipcomment;
929 #ifndef __MWERKS__
930     while ( ! in.eof() ) {
931 #else
932     char c = '\0';
933     while ( in.get(c) && c != '\0' ) {
934         in.putback(c);
935 #endif
936         string line;
937
938 #if defined( macintosh )
939         getline( in, line, '\r' );
940 #else
941         getline( in, line, '\n' );
942 #endif
943
944         // catch extraneous (DOS) line ending character
945         if ( line[line.length() - 1] < 32 ) {
946             line = line.substr( 0, line.length()-1 );
947         }
948
949         if ( line.find( "--fg-root=" ) == 0 ) {
950             return line.substr( 10 );
951         }
952
953         in >> skipcomment;
954     }
955
956     return "";
957 }
958
959
960 // Parse the command line options
961 void
962 fgParseOptions (int argc, char **argv) {
963     int i = 1;
964     int result;
965
966     SG_LOG(SG_GENERAL, SG_INFO, "Processing command line arguments");
967
968     while ( i < argc ) {
969         SG_LOG( SG_GENERAL, SG_DEBUG, "argv[" << i << "] = " << argv[i] );
970
971         result = parse_option(argv[i]);
972         if ( (result == FG_OPTIONS_HELP) || (result == FG_OPTIONS_ERROR) ) {
973             fgUsage();
974             exit(-1);
975         }
976
977         i++;
978     }
979 }
980
981
982 // Parse config file options
983 void
984 fgParseOptions (const string& path) {
985     sg_gzifstream in( path );
986     if ( !in.is_open() ) {
987         return;
988     }
989
990     SG_LOG( SG_GENERAL, SG_INFO, "Processing config file: " << path );
991
992     in >> skipcomment;
993 #ifndef __MWERKS__
994     while ( ! in.eof() ) {
995 #else
996     char c = '\0';
997     while ( in.get(c) && c != '\0' ) {
998         in.putback(c);
999 #endif
1000         string line;
1001
1002 #if defined( macintosh )
1003         getline( in, line, '\r' );
1004 #else
1005         getline( in, line, '\n' );
1006 #endif
1007
1008         // catch extraneous (DOS) line ending character
1009         if ( line[line.length() - 1] < 32 ) {
1010             line = line.substr( 0, line.length()-1 );
1011         }
1012
1013         if ( parse_option( line ) == FG_OPTIONS_ERROR ) {
1014             SG_LOG( SG_GENERAL, SG_ALERT, 
1015                     "Config file parse error: " << path << " '" 
1016                     << line << "'" );
1017             fgUsage();
1018             exit(-1);
1019         }
1020         in >> skipcomment;
1021     }
1022 }
1023
1024
1025 // Print usage message
1026 void 
1027 fgUsage ()
1028 {
1029     cout << "Usage: fgfs [ options ... ]" << endl;
1030     cout << endl;
1031
1032     cout << "General Options:" << endl;
1033     cout << "\t--help -h:  print usage" << endl;
1034     cout << "\t--fg-root=path:  specify the root path for all the data files"
1035          << endl;
1036     cout << "\t--fg-scenery=path:  specify the base path for all the scenery"
1037          << " data." << endl
1038          << "\t\tdefaults to $FG_ROOT/Scenery" << endl;
1039     cout << "\t--disable-game-mode:  disable full-screen game mode" << endl;
1040     cout << "\t--enable-game-mode:  enable full-screen game mode" << endl;
1041     cout << "\t--disable-splash-screen:  disable splash screen" << endl;
1042     cout << "\t--enable-splash-screen:  enable splash screen" << endl;
1043     cout << "\t--disable-intro-music:  disable introduction music" << endl;
1044     cout << "\t--enable-intro-music:  enable introduction music" << endl;
1045     cout << "\t--disable-mouse-pointer:  disable extra mouse pointer" << endl;
1046     cout << "\t--enable-mouse-pointer:  enable extra mouse pointer (i.e. for"
1047          << endl;
1048     cout << "\t\tfull screen voodoo/voodoo-II based cards.)" << endl;
1049     cout << "\t--disable-freeze:  start out in an running state" << endl;
1050     cout << "\t--enable-freeze:  start out in a frozen state" << endl;
1051     cout << "\t--control=mode:  primary control mode " 
1052          << "(joystick, keyboard, mouse)" << endl;
1053     cout << "\t--enable-auto-coordination:  enable auto coordination" << endl;
1054     cout << "\t--disable-auto-coordination:  disable auto coordination" << endl;
1055     cout << "\t--browser-app=/path/to/app:  specify location of your web browser" << endl;
1056     cout << "\t--prop:name=value:  set property <name> to <value>" << endl;
1057     cout << "\t--config=path:  load additional properties from path" << endl;
1058     cout << endl;
1059
1060     cout << "Features:" << endl;
1061     cout << "\t--disable-hud:  disable heads up display" << endl;
1062     cout << "\t--enable-hud:  enable heads up display" << endl;
1063     cout << "\t--disable-panel:  disable instrument panel" << endl;
1064     cout << "\t--enable-panel:  enable instrumetn panel" << endl;
1065     cout << "\t--disable-sound:  disable sound effects" << endl;
1066     cout << "\t--enable-sound:  enable sound effects" << endl;
1067     cout << "\t--disable-anti-alias-hud:  disable anti aliased hud" << endl;
1068     cout << "\t--enable-anti-alias-hud:  enable anti aliased hud" << endl;
1069     cout << endl;
1070  
1071     cout << "Flight Model:" << endl;
1072     cout << "\t--fdm=abcd:  selects the core flight model code." << endl;
1073     cout << "\t\tcan be one of jsb, larcsim, magic, external, balloon, or ada"
1074          << endl;
1075     cout << "\t--aircraft=abcd:  aircraft model to load" << endl;
1076     cout << "\t--model-hz=n:  run the FDM this rate (iterations per second)" 
1077          << endl;
1078     cout << "\t--speed=n:  run the FDM this much faster than real time" << endl;
1079     cout << "\t--notrim:  Do NOT attempt to trim the model when initializing JSBsim" << endl;
1080     cout << "\t--on-ground:  Start up at ground level (default)" << endl;
1081     cout << "\t--in-air:  Start up in air (implied by specifying an initial"
1082          << " altitude above ground level." << endl;
1083     cout << "\t--wind=DIR@SPEED: specify wind coming from DIR (degrees) at SPEED (knots)" << endl;
1084     cout << endl;
1085
1086     //(UIUC)
1087     cout <<"Aircraft model directory:" << endl;
1088     cout <<"\t--aircraft-dir=<path> path is relative to the path of the executable" << endl;
1089     cout << endl;
1090
1091     cout << "Initial Position and Orientation:" << endl;
1092     cout << "\t--airport-id=ABCD:  specify starting postion by airport id" 
1093          << endl;
1094     cout << "\t--offset-distance:  specify distance to threshhold"
1095          << " (NM)" << endl; 
1096     cout << "\t--offset-azimuth:  specify heading to threshhold (deg) " 
1097          << endl;    
1098     cout << "\t--lon=degrees:  starting longitude in degrees (west = -)" 
1099          << endl;
1100     cout << "\t--lat=degrees:  starting latitude in degrees (south = -)"
1101          << endl;
1102     cout << "\t--altitude=feet:  starting altitude in feet" << endl;
1103     cout << "\t\t(unless --units-meters specified" << endl;
1104     cout << "\t--heading=degrees:  heading (yaw) angle in degress (Psi)"
1105          << endl;
1106     cout << "\t--roll=degrees:  roll angle in degrees (Phi)" << endl;
1107     cout << "\t--pitch=degrees:  pitch angle in degrees (Theta)" << endl;
1108     cout << "\t--uBody=feet per second:  velocity along the body X axis"
1109          << endl;
1110     cout << "\t--vBody=feet per second:  velocity along the body Y axis"
1111          << endl;
1112     cout << "\t--wBody=feet per second:  velocity along the body Z axis"
1113          << endl;
1114     cout << "\t\t(unless --units-meters specified" << endl;
1115     cout << "\t--vc= initial airspeed in knots (--fdm=jsb only)" << endl;
1116     cout << "\t--mach= initial mach number (--fdm=jsb only)" << endl;
1117     cout << endl;
1118
1119     cout << "Rendering Options:" << endl;
1120     cout << "\t--fog-disable:  disable fog/haze" << endl;
1121     cout << "\t--fog-fastest:  enable fastest fog/haze" << endl;
1122     cout << "\t--fog-nicest:  enable nicest fog/haze" << endl;
1123     cout << "\t--enable-clouds:  enable demo cloud layer" << endl;
1124     cout << "\t--disable-clouds:  disable demo cloud layer" << endl;
1125     cout << "\t--clouds-asl=xxx:  specify altitude of cloud layer above sea level" << endl;
1126     cout << "\t--fov=xx.x:  specify initial field of view angle in degrees"
1127          << endl;
1128     cout << "\t--disable-fullscreen:  disable fullscreen mode" << endl;
1129     cout << "\t--enable-fullscreen:  enable fullscreen mode" << endl;
1130     cout << "\t--shading-flat:  enable flat shading" << endl;
1131     cout << "\t--shading-smooth:  enable smooth shading" << endl;
1132     cout << "\t--disable-skyblend:  disable sky blending" << endl;
1133     cout << "\t--enable-skyblend:  enable sky blending" << endl;
1134     cout << "\t--disable-textures:  disable textures" << endl;
1135     cout << "\t--enable-textures:  enable textures" << endl;
1136     cout << "\t--disable-wireframe:  disable wireframe drawing mode" << endl;
1137     cout << "\t--enable-wireframe:  enable wireframe drawing mode" << endl;
1138     cout << "\t--geometry=WWWxHHH:  window geometry: 640x480, 800x600, etc."
1139          << endl;
1140     cout << "\t--view-offset=xxx:  set the default forward view direction"
1141          << endl;
1142     cout << "\t\tas an offset from straight ahead.  Allowable values are"
1143          << endl;
1144     cout << "\t\tLEFT, RIGHT, CENTER, or a specific number of degrees" << endl;
1145     cout << "\t--visibility=xxx:  specify initial visibility in meters" << endl;
1146     cout << "\t--visibility-miles=xxx:  specify initial visibility in miles"
1147          << endl;
1148     cout << endl;
1149
1150     cout << "Scenery Options:" << endl;
1151     cout << "\t--tile-radius=n:  specify tile radius, must be 1 - 4" << endl;
1152     cout << endl;
1153
1154     cout << "Hud Options:" << endl;
1155     cout << "\t--units-feet:  Hud displays units in feet" << endl;
1156     cout << "\t--units-meters:  Hud displays units in meters" << endl;
1157     cout << "\t--hud-tris:  Hud displays number of triangles rendered" << endl;
1158     cout << "\t--hud-culled:  Hud displays percentage of triangles culled"
1159          << endl;
1160     cout << endl;
1161         
1162     cout << "Time Options:" << endl;
1163     cout << "\t--time-offset=[+-]hh:mm:ss: add this time offset" << endl;
1164     cout << "\t--time-match-real: Synchronize real-world and FlightGear" << endl
1165          << "\t\ttime. Can be used in combination with --time-offset." << endl;
1166     cout << "\t--time-match-local:Synchronize local real-world and " << endl
1167          << "\t\tFlightGear time" << endl;   
1168     cout << "\t--start-date-sys=yyyy:mm:dd:hh:mm:ss: specify a starting" << endl
1169          << "\t\tdate/time. Uses your system time " << endl;
1170     cout << "\t--start-date-gmt=yyyy:mm:dd:hh:mm:ss: specify a starting" << endl
1171          << "\t\tdate/time. Uses Greenwich Mean Time" << endl;
1172     cout << "\t--start-date-lat=yyyy:mm:dd:hh:mm:ss: specify a starting" << endl
1173          << "\t\tdate/time. Uses Local Aircraft Time" << endl;
1174 #ifdef FG_NETWORK_OLK
1175     cout << endl;
1176
1177     cout << "Network Options:" << endl;
1178     cout << "\t--enable-network-olk:  enable Multipilot mode" << endl;
1179     cout << "\t--disable-network-olk:  disable Multipilot mode (default)" << endl;
1180     cout << "\t--net-hud:  Hud displays network info" << endl;
1181     cout << "\t--net-id=name:  specify your own callsign" << endl;
1182 #endif
1183
1184     cout << endl;
1185     cout << "Route/Way Point Options:" << endl;
1186     cout << "\t--wp=ID[@alt]:  specify a waypoint for the GC autopilot" << endl;
1187     cout << "\t\tYou can specify multiple waypoints (a route) with multiple"
1188          << endl;
1189     cout << "\t\tinstances of --wp=" << endl;
1190     cout << "\t--flight-plan=[file]: Read all waypoints from [file]" <<endl;
1191 }