Re: option name collision with builtin 'include' special directive

Lorenzo Bettini <[email protected]> Tue, 26 Oct 2010 16:51:17 +0200
Newsgroups gmane.comp.gnu.gengetopt.general
Message-ID <[email protected]>
On 10/26/2010 04:31 PM, Papp Gyozo (VBuster) wrote:
> Hi there,
>
> Since version 2.19, it is possible to include other files (i.e., other configuration files) in a configuration file, by using the include syntax:
>
>       include "filename"
>
> http://www.gnu.org/software/gengetopt/gengetopt.html#Configuration-files
>
> Actually, we've run into the issue that our product has an option with same name: "include".
>
> My concerns are:
> - gengetopt runs fine without prompting there could be a potential problem.
> - gengetopt has no option to disable this feature or rename the builtin directive.
>    Ot at least I can't see, in this case please point it out to me.
>
> Unfortunately, we are in crazy hurry to publish the version of our product and we must keep backward compatibility, too. So changing the application is not option this time again.

Hi there

if you're in crazy hurry, I suggest you to manually modify the generated 
parser and remove the use of "include" as a keyword with another string 
(e.g., "FOOBAR"), in the line

if (!strcmp(fopt,"include")) {

this is a dirty hack but at least will keep you going for the moment.

Then, we can think of a solution for this... e.g., using an escape 
character for options whose name is right "include", e.g., "\include"...

hope to hear from you soon
cheers
	Lorenzo

-- 
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
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