Boost logo

Boost Users :

Subject: Re: [Boost-users] Program Options.. Specifying "-e" as an option value.....
From: Diederick C. Niehorster (dcnieho_at_[hidden])
Date: 2010-10-08 12:06:36


On Fri, Oct 8, 2010 at 06:19, <david.weber_at_[hidden]> wrote:
> I have an application, which spawns off other applications.  As input, it
> takes in environment variables and arguments to pass to the resultant
> application.  For instance:
>
> So.  Something funny comes along when I try to pass “-e” as an argument.
> So, in the above would be:
> mutate -a “-e” –a “foo” xterm
> The program options parser attempts to parse the “-e”, and says “I don’t
> know what it is”.
>

Oh, I see. The point was that you don't want -e to be parsed, but
stored by program_options. Could it be as simple as double quoting it
(""-e"") so that only the outer pair of quotes gets stripped by the
command line, leaving the inner pair and thus program_options not
picking up the option as a command (I hope it actually behaves like
that). Alternatively, it seems it might be better that you write your
own very simple command option parser that does what you need (e.g.
read everything after -a or -E until the other appears), instead of
rebuilding significant parts of program_options.

Best,
Dee


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