C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

command args processing lib(a la getopt), anyone?

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated)
View previous topic :: View next topic  
Author Message
dima
Guest





PostPosted: Sat Aug 30, 2003 8:02 pm    Post subject: command args processing lib(a la getopt), anyone? Reply with quote



can anybody recommend a good open-source library for command args processing in C++?
something like getopt, but in C++.
thanks.
d.

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
Peter van Merkerk
Guest





PostPosted: Sun Aug 31, 2003 8:09 am    Post subject: Re: command args processing lib(a la getopt), anyone? Reply with quote



news:5c72b580.0308291723.12c61d1a (AT) posting (DOT) google.com...
Quote:
can anybody recommend a good open-source library for command args
processing in C++?
something like getopt, but in C++.
thanks.

The ACE library (http://www.cs.wustl.edu/~schmidt/ACE.html) has a
ACE_Arg_Shifter class for this. But using this huge library just for command
line processing would be overkill.

--
Peter van Merkerk
peter.van.merkerk(at)dse.nl





[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Ulrich Eckhardt
Guest





PostPosted: Mon Sep 01, 2003 12:58 am    Post subject: Re: command args processing lib(a la getopt), anyone? Reply with quote



dima wrote:
Quote:
can anybody recommend a good open-source library for command args
processing in C++? something like getopt, but in C++.

I seem to remember one called getpot (no typo!), boost also had something
cooking in that direction.

cheers

Uli

--
Questions ?
see C++-FAQ Lite: http://parashift.com/c++-faq-lite/ first !


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Ole Laursen
Guest





PostPosted: Mon Sep 01, 2003 1:00 am    Post subject: Re: command args processing lib(a la getopt), anyone? Reply with quote

[email]dbabits (AT) hotmail (DOT) com[/email] (dima) writes:

Quote:
can anybody recommend a good open-source library for command args
processing in C++? something like getopt, but in C++.

I have one here

http://www.cs.auc.dk/~olau/commandoptions/

It gives a decent user interface with an absolute minimum of work.

--
Ole Laursen
http://www.cs.auc.dk/~olau/

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
White Wolf
Guest





PostPosted: Mon Sep 01, 2003 1:10 am    Post subject: Re: command args processing lib(a la getopt), anyone? Reply with quote

dima wrote:
Quote:
can anybody recommend a good open-source library for command args
processing in C++? something like getopt, but in C++.

It seems that GNU getopt does have some C++ support:

http://www.fnal.gov/docs/products/gcc/libg++/libg++_39.html

--
WW aka Attila



[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
llewelly
Guest





PostPosted: Mon Sep 01, 2003 11:57 am    Post subject: Re: command args processing lib(a la getopt), anyone? Reply with quote

"White Wolf" <wolof (AT) freemail (DOT) hu> writes:

Quote:
dima wrote:
can anybody recommend a good open-source library for command args
processing in C++? something like getopt, but in C++.

It seems that GNU getopt does have some C++ support:

http://www.fnal.gov/docs/products/gcc/libg++/libg++_39.html

But libg++ has not been supported for years. I don't think it builds
with current gcc either.

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
E. Robert Tisdale
Guest





PostPosted: Tue Sep 02, 2003 5:50 am    Post subject: Re: command args processing lib(a la getopt), anyone? Reply with quote

dima wrote:

Quote:
can anybody recommend a good open-source library for command args processing in C++?
something like getopt, but in C++.

GNU Gengetopt 2.0

http://www.gnu.org/software/gengetopt/gengetopt.html


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
kanze@gabi-soft.fr
Guest





PostPosted: Tue Sep 02, 2003 5:52 am    Post subject: Re: command args processing lib(a la getopt), anyone? Reply with quote

[email]dbabits (AT) hotmail (DOT) com[/email] (dima) wrote in message
news:<5c72b580.0308291723.12c61d1a (AT) posting (DOT) google.com>...

Quote:
can anybody recommend a good open-source library for command args
processing in C++? something like getopt, but in C++.

Check out the GB_CommandLine class at my site. There are also a certain
number of predefined options in the Options directory.

The basic principle is simple: GB_CommandLine is a singleton. The
options are all static instances of a class derived from GB_Option,
whose constructor enrols them with GB_CommandLine. After being fed the
argc, argv parameters, the options in the command line have been set and
stripped from the list of parameters; what remains looks like an
std::vector< std::string > with the non-option parameters, and is a good
candidate for providing the iterators necessary for my
MultipleFileInputStream.

--
James Kanze GABI Software mailto:kanze (AT) gabi-soft (DOT) fr
Conseils en informatique orientée objet/ http://www.gabi-soft.fr
Beratung in objektorientierter Datenverarbeitung
11 rue de Rambouillet, 78460 Chevreuse, France, +33 (0)1 30 23 45 16

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Ben Hutchings
Guest





PostPosted: Wed Sep 03, 2003 12:37 am    Post subject: Re: command args processing lib(a la getopt), anyone? Reply with quote

In article <3F529FEF.5060202 (AT) jpl (DOT) nasa.gov>, E. Robert Tisdale wrote:
Quote:
dima wrote:

can anybody recommend a good open-source library for command args
processing in C++? something like getopt, but in C++.

GNU Gengetopt 2.0

That generates C code, though I wonder whether it really matters.
Note that the licence is GPL rather than LGPL, and given the FSF
claims the GPL applies to Bison output I expect they would say the
same about this program's output.

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
apm
Guest





PostPosted: Wed Sep 03, 2003 3:38 pm    Post subject: Re: command args processing lib(a la getopt), anyone? Reply with quote

[email]dbabits (AT) hotmail (DOT) com[/email] (dima) wrote in message news:<5c72b580.0308291723.12c61d1a (AT) posting (DOT) google.com>...
Quote:
can anybody recommend a good open-source library for command args processing in C++?
something like getopt, but in C++.
thanks.
d.

Try Brad Appleton's library:-

http://www.cmcrossroads.com/bradapp/ftp/src/libs/C++/Options.html

Regards,

Andrew Marlow

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
llewelly
Guest





PostPosted: Fri Sep 05, 2003 1:10 am    Post subject: Re: command args processing lib(a la getopt), anyone? Reply with quote

Ben Hutchings <do-not-spam-benh (AT) bwsint (DOT) com> writes:

Quote:
In article <3F529FEF.5060202 (AT) jpl (DOT) nasa.gov>, E. Robert Tisdale wrote:
dima wrote:

can anybody recommend a good open-source library for command args
processing in C++? something like getopt, but in C++.

GNU Gengetopt 2.0

That generates C code, though I wonder whether it really matters.
Note that the licence is GPL rather than LGPL, and given the FSF
claims the GPL applies to Bison output

They make the opposite claim, unless you have an old version of
bison. (I do not know when bision 1.24, the last version to which
your statement applies, was released, but I am fairly sure it was
before the creation of the current bison cvs tree, which was
created in 1996 or 1997.)

http://www.gnu.org/manual/bison/html_node/Conditions.html#Conditions

Quote:
I expect they would say the
same about this program's output.

They make the opposte claim for genegetopt as well, see

http://www.gnu.org/software/gengetopt/gengetopt.html


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.