Boost logo

Boost Users :

Subject: [Boost-users] [program_options] positional options starting with a '-' sign
From: Ian McCulloch (ianmcc_at_[hidden])
Date: 2009-07-22 23:59:09


Hi,

I have an app using program_options, which has various optional arguments,
followed by any number of floating point numbers, which are read as
positional options.

A user just pointed out that it fails with an 'unknown option -0' error if
any of those positional options are negative, because it tries to interpret
a number like "-0.34" as an option.

Is there a way to treat unregistered options as positional arguments?
allow_unregistered() doesn't quite do it - it doesn't give an error anymore
but neither does it treat "-0.34" as a positional option (even if it is not
the first positional argument).

Regards,
Ian McCulloch


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