help-gengetopt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [help-gengetopt] Ignoring flags in the command line


From: Lorenzo Bettini
Subject: Re: [help-gengetopt] Ignoring flags in the command line
Date: Thu, 03 May 2007 17:08:36 +0200
User-agent: Thunderbird 2.0.0.0 (X11/20070424)

address@hidden 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]