Boost logo

Boost Users :

From: Merrill Cornish (merrill.cornish_at_[hidden])
Date: 2006-02-07 21:36:28


I have this problem that while program options works just fine for processing registered options, an unregistered option triggers a MS runtime exception (I'm using MinGW, so it uses MS runtime) that can't be caught at the C++ level. My store() function is shown below:

    po::store(po::command_line_parser(argc, argv).
        options(all_verbose).
        positional(pd).
        run(), vm);

I saw the allow_unregistered() feature. I thought this would be a way to get all illegal command line options "out of the way" so they couldn't trigger the exception. So I modified the above to be:

    po::store(po::command_line_parser(argc, argv).
        options(all_verbose).
        positional(pd).
        allow_unregistered().
        run(), vm);

However, putting an illegal argument on the command line, say --x, still gives the message, "This application has requested the Runtime to terminate it in an unusual way."

Is an unregistered option triggering some sort of NULL access?

Merrill


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