Boost logo

Boost Users :

Subject: [Boost-users] [program_options] allow_guessing issue
From: Filip Konvička (filip.konvicka_at_[hidden])
Date: 2010-02-25 15:23:28


Hi,

I've just upgraded to boost 1.42 from 1.40, and it seems that the new
feature 'allow_guessing', a default setting, breaks my existing code. I
have two options: "lang" and "lang-dir", the first obviously a prefix of
the other, and when my program is run with "--lang=en_US --lang-dir=.",
the first argument is interpreted as "lang-dir". Even though the
documentation says somewhere that one argument should not be a prefix of
another with 'allow_guessing' on, this is a breaking change and should
be put in a big red box somewhere on the front page :-)

If the change is intended to be kept for the future, it would be wise to
detect the problem by examining the options, rather than wait until
another problem occurs (in my case, the runtime exception is
'multiple_options' when the user uses both options, and - much worse! -
the option gets misinterpreted without a warning if he only uses the
shorter option).

Cheers,
Filip


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