Boost logo

Boost Users :

From: Rui Maciel (rui.maciel_at_[hidden])
Date: 2006-11-09 15:29:34


I've just discovered boost's program_options and at first glance it looked
exactly what I was searching for, which was a easy to use library which was
capable of handling the command line arguments parsing in a fast and
efficient way.

Unfortunately one of the things which I had my mind set to was the
possibility of defining precedent options. To put it in other words, enable
the parser to accept some options only if they were casted in a particular
order and complain if that order wasn't respected. For example, accepting
something like:

app --add --file

but complain if the arguments are like:

app --file --add
or
app --add

One other thing that I was hoping that boost's program_options was capable
of handling was some sort of semantic interpretation according to the
option's orders. Take this case for example:

app --add --file --remove --file

What I was hoping for was that program_options was capable of interpreting
the first invocation of --file as relating to --add and the second
invocation relating to --remove, instead of intepreting as two distinct
invocations of --file.

So, is it possible to accomplish that with boost's program_options? If so,
could anyone be so kind to provide a simple example?

Thanks in advance
Rui Maciel

-- 
Running Kubuntu 6.10 with KDE 3.5.5 and proud of it.
jabber:rui_maciel_at_[hidden]

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net