Re: Feature request: write_into_file prints *_arg, too
Lorenzo Bettini <[email protected]> Sat, 15 Dec 2007 16:57:48 +0100
| Newsgroups | gmane.comp.gnu.gengetopt.general |
|---|---|
| Message-ID | <[email protected]> |
Hi this version http://rap.dsi.unifi.it/~bettini/gengetopt-2.22b.tar.gz should implement also this feature: it saves (in a comment) also the corresponding actual value for options with values (and enums) I'd be ready with 2.22 release by next week hope to hear from you soon Lorenzo Papp Gyozo (VBuster) wrote: >>> I think it vould be very handsome for diagnosting purposes, if not >>> only can the options' _orig field be printed/dumped by the parser but >>> their translated/interpreted _arg fields as well, probably as a >>> comment: >>> >>> option = "ele" # element >>> >>> The point here is that application may alter the user-supplied >>> arguments, thus when dumping the actual config it may worth knowing >>> what the application really thinks abou the options' actual value. >>> >> yes that'd be helpful; of course, this makes sense only for options with >> values right? > > As far as I see, yes. (Actually I'd like to use only for enums ;) and strings.) > >> well it should be "quite" simple: >> >> - first of all, I assume this will be done only for options with values >> - in this case, output the element of the array holding the string >> values for an option with values (using the correct index) > > well, actually I > > I took a look at generated source and I figured out I would have to modify write_into_file() function. I don't see how it would be the best though... > >> Notice that I'd avoid print numeric values since their conversion into > > Oh, I thought _orig always contains the original string representation from argv[]. By the way, it doesn't matter me right now as I said before I want to use it for string option in first place. > > > _______________________________________________ > Help-gengetopt mailing list > [email protected] > http://lists.gnu.org/mailman/listinfo/help-gengetopt > -- Lorenzo Bettini, PhD in Computer Science, DSI, Univ. di Firenze ICQ# lbetto, 16080134 (GNU/Linux User # 158233) HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com http://www.myspace.com/supertrouperabba BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com http://www.gnu.org/software/src-highlite http://www.gnu.org/software/gengetopt http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net