Boost logo

Boost Users :

Subject: [Boost-users] [program_options] printing options summary
From: Stanisław Findeisen (stanislaw.findeisen_at_[hidden])
Date: 2010-04-15 07:56:33


[This question is about Boost.program_options library.]

When I want to print options summary (e.g., for --help) I do this:

    cout << optionsDesc

where optionsDesc is:

    boost::program_options::options_description optionsDesc;

The output is correct, but how to format it? It looks bad:

  --mode arg [must be set] [........] mode: 'f' to gener
                                    ate file, or 'x' to fix file, or 'p' to gen
                                    erate ...

Option descriptions are too narrow, and some words are broken right in the middle. (There is a big gap here between "mode" and its description because other option names are quite long.)

It would be nice to be able to print wider option descriptions or maybe option descriptions *below* option names and somewhat indented (instead of to the right).

Are there any formatting options?

Thanks!

STF


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