program_options

warning: Creating default object from empty value in /mnt/web005/a1/00/51694400/htdocs/bwy/public_html/sites/all/modules/i18n/i18ntaxonomy/i18ntaxonomy.pages.inc on line 34.

Boost Program Options accumulator type

After various requests, I've licensed my boost program_options extension code accumulator.hpp under the Boost Software License 1.0. It also now supports taking an argument on construction to store the value as well as the notifier function.

To recap: the accumulator type adds support for repeated options used to increment a particular value. Often this is used for verbosity, so that -v sets a verbosity level of one, -vvv a level of three.

Boost Program Options

Boost's program_options library does a lot of things (such as formatting help messages and adding default values) automatically, and it means different program modules can add and handle their own options. This is exactly what we need it for.

Its main disadvantage is incomplete documentation. There are some common command-line behaviours that aren't built in, which is fine as long as they can be added. And indeed program_options is fairly extensible and flexible, which in turn is fine as long as you have documentation to tell you how to do it.

Inhalt abgleichen