|
Boost Users : |
Subject: Re: [Boost-users] Program Options.. Specifying "-e" as an optionvalue.....
From: david.weber_at_[hidden]
Date: 2010-10-08 11:54:25
So, I was poking around in the test cases, and I run across this in cmdline_test.cpp:
void test_long_options()
{
...
test_case test_cases2[] = {
{"--bar 10", s_success, "bar:10"},
{"--bar", s_missing_parameter, ""},
******
// Since --bar accepts a parameter, --foo is
// considered a value, even though it looks like
// an option.
{"--bar --foo", s_success, "bar:--foo"},
******
{0, 0, 0}
};
test_cmdline("foo bar=", style, test_cases2);
style = cmdline::style_t(
allow_long | long_allow_adjacent
| long_allow_next);
...
}
And further down:
void test_short_options()
{
...
test_case test_cases2[] = {
{"-f 13", s_success, "-f:13"},
{"-f -13", s_success, "-f:-13"},
{"-f", s_missing_parameter, ""},
{"-f /foo", s_success, "-f:/foo"},
******
{"-f -d", s_missing_parameter, ""},
******
{0, 0, 0}
};
test_cmdline(",d ,f=", style, test_cases2);
...
}
So, it would appear that if both arguments are âlong-formâ then my problem would go away. But since Iâm passing in the short-form arguments (xtermâs âe option has no long-form), I am boned. I think I tried to pass the short-form in as a long form (i.e.: â--arg=-eâ and â--arg âeâ), but I think that these failed as well.
Time for some more playing around.........
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