On Wed, Aug 18, 2010 at 09:40:43PM -0500, Steve M. Robbins wrote: > On Wed, Aug 18, 2010 at 11:55:02PM +0100, Roger Leigh wrote: > > Package: libboost-program-options1.42.0 > > Version: 1.42.0-4 > > Severity: important > > > > Hi, > > > > schroot (version 1.4.8-1 in unstable) has broken options parsing > > due to what looks like a Boost regression. > > Can you provide a minimal code example, together with > expected and actual outputs? I can pass it upstream.
Attached. This is the output: $ g++ -o test test.cc -lboost_program_options $ ./test --all all-source-chroots $ ./test --all-chroots all-chroots $ ./test --all-sessions all-sessions $ ./test --all-source-chroots all-source-chroots so you can clearly see that --all is actually being treated by boost_program_options as being --all-source-chroots. Regards, Roger -- .''`. Roger Leigh : :' : Debian GNU/Linux http://people.debian.org/~rleigh/ `. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/ `- GPG Public Key: 0x25BFB848 Please GPG sign your mail.
#include <iostream>
#include <string>
#include <vector>
#include <boost/program_options.hpp>
using std::endl;
namespace opt = boost::program_options;
int
main (int argc, char* argv[])
{
boost::program_options::options_description chroot;
boost::program_options::options_description global;
boost::program_options::variables_map vm;
std::vector<std::string> chroots;
chroot.add_options()
("all,a",
"Select all chroots and active sessions")
("all-chroots",
"Select all chroots")
("all-sessions",
"Select all active sessions")
("all-source-chroots",
"Select all source chroots")
("chroot,c", opt::value<std::vector<std::string> >(&chroots),
"Use specified chroot");
global.add(chroot);
opt::store(opt::command_line_parser(argc, argv).
options(global).run(), vm);
opt::notify(vm);
if (vm.count("all"))
std::cout << "all" << std::endl;
if (vm.count("all-chroots"))
std::cout << "all-chroots" << std::endl;
if (vm.count("all-sessions"))
std::cout << "all-sessions" << std::endl;
if (vm.count("all-source-chroots"))
std::cout << "all-source-chroots" << std::endl;
return 0;
}
signature.asc
Description: Digital signature

