Rewrite help output from Options
(Partially) rewrite the way command-line help is printed for an Options
object. Now man pages and HTML output are supported in addition to
console output. The console output is formatted in a simpler manner,
since there is no longer any need to cater for user-provided values in
the output. There is some extra machinery now in cmdlinehelpwriter.cpp,
but left it there as it may still be useful in the future, and it does
structure the code a bit more cleanly.
As an extra bonus, the commandline module should no longer depend on the
selection module.
Things more or less work, but the following could still be addressed,
either in this change or later:
- Re-add selection option help formatting tests somewhere else.
- Add unit tests for various things about non-console help formatting.
- Refactor the way the help information is fetched from OptionInfo
objects: it would be cleaner to have a single method that returns all
the information in a struct, instead of multiple virtual methods that
return different pieces of information, many of which are not
required for anything else except the help output.
- Add proper synopsis that lists all the options.
Part of #969.
Change-Id: Iadf1b5df15f278547d5db6407f3e3c689fb88645
30 files changed: