Re: Ignoring flags in the command line

Lorenzo Bettini <[email protected]>
Newsgroups gmane.comp.gnu.gengetopt.general
Message-ID <[email protected]>
[email protected] wrote:
> Hi all,
> 
> I am trying to use gengetopt in my project and so far it's great but the following issue came up :
> We have several plug-ins that should use the same command line, but each has different options. I want to be able to use ggo in each of them but let it ignore options it does not recognize (since they should probably be parsed by a different plug-in).
> 
> So what I need is to be able to do something like this :
> legal flags :
> -a <value>
> -b
> 
> Command line :
> <exe> -b -c -a 7
> 
> and I want to get a=7, b=true without any errors because of the "-c".
> 
> I'll be gald to head any ideas on how to do it.
> 

Hi Rina

I here summarize the private discussion we've already had

one possibility is to have an option for gengetopt (say, --failsafe) 
that generates a parser that does not exit or report an error in case an 
option is not recognized and the parts not recognized can be put in a 
field for later processing

the other one, is to let the options for a plugin to be the argument of 
an option of the main program; there's a section in the manual of 
gengetopt to deal with such a situation: 
http://www.gnu.org/software/gengetopt/gengetopt.html#String-Parsers-and-Multiple-Parsers

however, the --failsafe option (probably it's not the best choice for a 
name) would be interesting anyhow, so I'll probably add this 
functionality too.

hope to hear from you soon
cheers
	Lorenzo

-- 
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
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.