Re: [C++] Command line parser
- From: cri@xxxxxxxx (Richard Harter)
- Date: Thu, 26 Apr 2007 16:16:05 GMT
On Thu, 26 Apr 2007 09:26:24 +0200, AD <adeon@xxxxxxxxxxxxxx> wrote:
Hi,
Is there any command line parser which could handle long options preceded with single dash (e.g. "-help")?
Adam
There are at least two major packages for doing that, the gcc getopt
package and the popt package. Gcc getopt has two variants, long and
short. The short variant is the traditional getopt - options are
specified with an option string and are single letter. The long variant
permits long names; options are specified in a table. In both variants
the usage code has a loop and a switch statement.
The popt package supports long names; in it options are also specified
in a table. The interface is cleaner than the getopt interface.
Typically the usage code only needs to make a single call to the popt
package. It also has a bunch of nice options that you probably don't
need.
.
Relevant Pages
- Re: Re-exporting primitive operations of a private type (like "-", and min)
... The full type declarations would be in the private part of the package, ... In such declarations, the "private" keyword is perhaps unnecessary, since the presence of the box "" shows that the declared type is partly hidden. ... For some reason (say, different platforms or different product variants) you have several variants of package A, say A', A" and so on. ... The contract aspect of Ada generics is a good thing, but it is one-sided: it only lets the generic unit specify what it *expects* of a type that it will be given; there is now no similar way to specify what a unit *promises* of a type that it *provides*. ... (comp.lang.ada) - Re: Compiling Angband variants on Unixes
... I've started packaging a few roguelike games for the Debian Linux ... I'd like to package some Angband variants as well, ... So if anybody out there has custom Makefile for building any of the *bands ... Other variants that are popular that you might want to package: ... (rec.games.roguelike.angband) - CTAN has a new package: show2e
... Summary description: \show variants for LaTeX2e ... This small package aims at making debugging (esp. ... macros used by such commands, ... (comp.text.tex) - Re: TCP variants on BSD
... > I'm looking for an OS on which I can run the following TCP ... > Is any of the xBSDs is able to run all of a subset of them. ... > one I can use after installing some available package? ... (comp.unix.bsd.netbsd.misc) - Re: SAMBA problems.
... Craig Burtenshaw wrote: ... Where did you source the package? ... certainly appears that you need a popt package at a minimum! ... Seeing as you have an Australian email address in your sig, ... (comp.unix.solaris) |
|