re: [Flightgear-devel] Re: Patch for options.cxx
Curtis L. Olson writes: Since we went a couple rounds on this before, I thought I would post this on the mailing list for discussion first. This patch moves all the command line help text to an xml file and then loads it at run time, rather than having the text hard coded into the source. Sound like a good idea? Any objections? It sounds harmless. All the best, David -- David Megginson, [EMAIL PROTECTED], http://www.megginson.com/ ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Re: Patch for options.cxx
David Megginson wrote: Curtis L. Olson writes: Since we went a couple rounds on this before, I thought I would post this on the mailing list for discussion first. This patch moves all the command line help text to an xml file and then loads it at run time, rather than having the text hard coded into the source. Sound like a good idea? Any objections? It sounds harmless. Of course it's harmless, everything I do has the intention to be harmless! ;-) Erik ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Re: Patch for options.cxx
Curtis L. Olson [EMAIL PROTECTED] said: Since we went a couple rounds on this before, I thought I would post this on the mailing list for discussion first. This patch moves all the command line help text to an xml file and then loads it at run time, rather than having the text hard coded into the source. There must be a reason for not having it hard coded, but I can't think of what it would be. Is this just to make minor spelling/syntax corrections without rebuilding...or are you looking toward supporting multiple languages? Best, Jim ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Re: Patch for options.cxx
Jim Wilson writes: Curtis L. Olson [EMAIL PROTECTED] said: Since we went a couple rounds on this before, I thought I would post this on the mailing list for discussion first. This patch moves all the command line help text to an xml file and then loads it at run time, rather than having the text hard coded into the source. There must be a reason for not having it hard coded, but I can't think of what it would be. Is this just to make minor spelling/syntax corrections without rebuilding...or are you looking toward supporting multiple languages? I think in my mind the main reason would be to allow the text to be edited in a form that looks like the final result rather than having it wrapped up and obfuscated by a bunch of cout type stuff. Curt. -- Curtis Olson IVLab / HumanFIRST Program FlightGear Project Twin Cities[EMAIL PROTECTED] [EMAIL PROTECTED] Minnesota http://www.menet.umn.edu/~curt http://www.flightgear.org ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Re: Patch for options.cxx
Jim Wilson writes: There must be a reason for not having it hard coded, but I can't think of what it would be. Is this just to make minor spelling/syntax corrections without rebuilding...or are you looking toward supporting multiple languages? It would be interesting to make options themselves configurable, as in PropertyList option nameheading/name argtrue/arg property/orientation/heading-deg/property descriptionInitial heading in degrees true./description /option option namepitch/name argtrue/arg property/orientation/pitch-deg/property descriptionInitial pitch in degrees true./description /option option namedisable-panel/name argfalse/arg property/sim/panel/visibility/property valuefalse/value descriptionHide the control panel on startup./description /option option nameenable-panel/name argfalse/arg property/sim/panel/visibility/property valuetrue/value descriptionShow the control panel on startup./description /option !-- and so on -- /PropertyList It would be much easier to keep the help text up-to-date this way, though a few of the options would be trickier (the ones that require special parsing of the argument, for example). Any volunteers? All the best, David -- David Megginson, [EMAIL PROTECTED], http://www.megginson.com/ ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Re: Patch for options.cxx
Curtis L. Olson wrote: ... patch moves all the command line help text to an xml file and then loads it at run time, rather than having the text hard coded into the source. Sound like a good idea? Any objections?... It is an obvious and long needed improvement. However, if I read the code correctly, it seems to throw an exception if it cannot find the xml help file. If the file isn't needed because an error wasn't made, does the program abort because it cannot find the file? Admittedly I'm being lazy in not testing this myself. Regards, Charlie H.. -- C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg. - Bjarne Stroustrup ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Re: Patch for options.cxx
Jim Wilson wrote: Curtis L. Olson [EMAIL PROTECTED] said: Since we went a couple rounds on this before, I thought I would post this on the mailing list for discussion first. This patch moves all the command line help text to an xml file and then loads it at run time, rather than having the text hard coded into the source. There must be a reason for not having it hard coded, but I can't think of what it would be. Is this just to make minor spelling/syntax corrections without rebuilding...or are you looking toward supporting multiple languages? First of all, I don't like string constants which are larger than 4k, hardcoded into the binary. And second it's easier to update, easier to translate, etc. Erik ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Re: Patch for options.cxx
C. Hotchkiss wrote: Curtis L. Olson wrote: ... patch moves all the command line help text to an xml file and then loads it at run time, rather than having the text hard coded into the source. Sound like a good idea? Any objections?... It is an obvious and long needed improvement. However, if I read the code correctly, it seems to throw an exception if it cannot find the xml help file. If the file isn't needed because an error wasn't made, does the program abort because it cannot find the file? Admittedly I'm being lazy in not testing this myself. It only throws an exception when --help (or an incorrect argument) was specified or *and* the file options.xml doesn't exsist. Erik ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Re: Patch for options.cxx
David Megginson wrote: Jim Wilson writes: There must be a reason for not having it hard coded, but I can't think of what it would be. Is this just to make minor spelling/syntax corrections without rebuilding...or are you looking toward supporting multiple languages? It would be interesting to make options themselves configurable, as in PropertyList option nameheading/name argtrue/arg property/orientation/heading-deg/property descriptionInitial heading in degrees true./description /option !-- and so on -- /PropertyList It would be much easier to keep the help text up-to-date this way, though a few of the options would be trickier (the ones that require special parsing of the argument, for example). Any volunteers? Hmm, good thinking. I have to think about it some more to see the implications. Erik ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Re: Patch for options.cxx
Erik Hofman wrote: C. Hotchkiss wrote: ... If the file isn't needed because an error wasn't made, does the program abort because it cannot find the file? Admittedly I'm being lazy in not testing this myself. It only throws an exception when --help (or an incorrect argument) was specified or *and* the file options.xml doesn't exsist. So, does the program abort or advise and go on? I'm thinking that the exception event would be rare, but even so, a miss installation or an accidentally deleted file shouldn't leave the user scratching his or her head. When easily done, good hints about why things went wrong should be given. Regards, Charlie H. -- C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg. - Bjarne Stroustrup ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Re: Patch for options.cxx
If the program cannot find options.xml, I strongly suggest that it still should give a sensible (if brief) reply to --help. This reply should tell the user how to help it to find options.xml. - Julian C. Hotchkiss wrote: Erik Hofman wrote: C. Hotchkiss wrote: ... If the file isn't needed because an error wasn't made, does the program abort because it cannot find the file? Admittedly I'm being lazy in not testing this myself. It only throws an exception when --help (or an incorrect argument) was specified or *and* the file options.xml doesn't exsist. So, does the program abort or advise and go on? I'm thinking that the exception event would be rare, but even so, a miss installation or an accidentally deleted file shouldn't leave the user scratching his or her head. When easily done, good hints about why things went wrong should be given. ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel