Showing posts with label getopt. Show all posts
Showing posts with label getopt. Show all posts

Friday, September 29, 2006

GNU Gengetopt 2.18

I released few days ago the new version of GNU Gengetopt, http://www.gnu.org/software/gengetopt, a GNU program I'm the maintainer of.

Gengetopt is a generator of parsers of command line options.

It generates a C function that uses getopt_long function to parse the command line options, to validate them and fills a struct. Thus your program can handle options such as:

myprog --input foo.c -o foo.o --no-tabs -i 100 *.class
And both long options (those that start with --) and short options (start with - and consist of only one character) can be handled. For standards about short and long options you may want to take a look at the GNU Coding Standards.

Command line options are an important feature of every non trivial programs. The getopt functions already do a good job in parsing them, but a lot of programming is still require... Gengetopt will do this additional programming for you, and you simply have to provide a file with the specification of the options your program accepts.

I refer the interested programmers to gengetopt's documentation.