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

D

dima

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

Ulrich Eckhardt

dima said:
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
 
K

kanze

(e-mail address removed) (dima) wrote in message
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.
 
B

Ben Hutchings

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.
 
L

llewelly

Ben Hutchings said:
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
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top