|
Boost Users : |
Subject: Re: [Boost-users] Boost Program Options Optional Value (request for implicit_value() behaviour change to allow space)
From: Andrei LIHU (andrei.lihu_at_[hidden])
Date: 2008-10-08 10:48:04
Well, I thought so, but I tested that , and it doesn't do that. Here
are my styles:
po::command_line_style::style_t pstyle = po::command_line_style::style_t(
po::command_line_style::short_allow_next |
po::command_line_style::allow_dash_for_short |
po::command_line_style::allow_long |
po::command_line_style::allow_short |
po::command_line_style::long_allow_next |
po::command_line_style::case_insensitive |
po::command_line_style::allow_long_disguise );
// store the values in the variables' map
po::store(po::basic_command_line_parser<TCHAR>(args).style(pstyle).options(m_cmdlineOptions).allow_unregistered().run(),
m_vm);
po::notify(m_vm);
2008/10/8 Boris <boriss_at_[hidden]>:
> On Wed, 08 Oct 2008 11:23:29 +0200, Andrei LIHU <andrei.lihu_at_[hidden]>
> wrote:
>
>> [...]So far I found a solution based on implicit_value() behaviour, with
>> "-b" of type string, but my main problem is that in this case I am
>> forced to enter the value to be adjacent to "-b" (e.g.
>> -b"C:\otherlogfile.log"). The desired form would be the one with a
>> space between, in order to maintain our backward compatibility of
>> scripts (e.g: -b "C:\otherlogfile.log").
>
> If -b is a short option I would have thought that
> command_line_style::short_allow_next does what you want?
>
> Boris
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
-- Kind regards, Andrei LIHU -------------------- Soft NRG C++ Software Developer +40742545392
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