Rewrote command line help writer.
authorTeemu Murtola <teemu.murtola@gmail.com>
Thu, 26 Apr 2012 05:59:37 +0000 (08:59 +0300)
committerTeemu Murtola <teemu.murtola@gmail.com>
Thu, 3 May 2012 04:32:49 +0000 (07:32 +0300)
commitb514fd2768c57363ed708eef190af2e2d35b2174
tree3b83cf751ad2502c152d93f4e0547c755e6930d8
parent9f6e7ee8da37e32e216e73fb39376b316453dbe5
Rewrote command line help writer.

- Rewrote printing code for options using TextTableFormatter. Should now
  produce at least as good output as the old code invoked by
  parse_common_args() while keeping most of the layout, and in some
  cases does significantly better (partly because of the item below).
- Split selection options into a separate table with its own formatting
  to make more space for long values that they typically have.
- Added test code that exercises different parts of the formatting code
  and allows one to easily see the output (with -stdout cmd-line
  parameter to the test executable).  Without the -stdout parameter,
  each test is marked as failed if anything in the output changes,
  allowing them to work as regression tests.
- Added line wrapping for descriptions.
- Markup substitution ([TT], [PAR] etc.) is not yet done. Will add that
  separately, since it requires changes to the line wrapping code to
  strip some whitespace...

There are some TODOs in the code, but they mostly concern better
handling of corner or more complex cases.

IssueID #666

Change-Id: I538fbaac27572a518d24dff7b0f30f8746a540af
src/gromacs/commandline/cmdlinehelpwriter.cpp
src/gromacs/commandline/tests/CMakeLists.txt
src/gromacs/commandline/tests/cmdlinehelpwriter.cpp [new file with mode: 0644]
src/gromacs/commandline/tests/refdata/CommandLineHelpWriterTest_HandlesLongFileOptions.xml [new file with mode: 0644]
src/gromacs/commandline/tests/refdata/CommandLineHelpWriterTest_HandlesLongOptions.xml [new file with mode: 0644]
src/gromacs/commandline/tests/refdata/CommandLineHelpWriterTest_HandlesMultipleSections.xml [new file with mode: 0644]
src/gromacs/commandline/tests/refdata/CommandLineHelpWriterTest_HandlesOptionTypes.xml [new file with mode: 0644]
src/gromacs/commandline/tests/refdata/CommandLineHelpWriterTest_HandlesSelectionOptions.xml [new file with mode: 0644]
src/gromacs/options/optioninfo.h
src/gromacs/options/optionsvisitor.cpp