Draft support for multiple help output formats.
authorTeemu Murtola <teemu.murtola@gmail.com>
Sun, 15 Jul 2012 09:51:07 +0000 (12:51 +0300)
committerTeemu Murtola <teemu.murtola@gmail.com>
Sun, 15 Jul 2012 13:48:48 +0000 (16:48 +0300)
commit1eb59d9adbea0b7607eba712fbb4250ac9850007
tree1b502441cc9ac5be5a890492a6476603577ae0b9
parent6ac472288271ac8afcda1d934083271db0c3dc08
Draft support for multiple help output formats.

- Added a HelpWriterContext class. An instance is now passed to all
  methods that write help text.  In addition to keeping track of the
  output format, it also allows other context information to be kept
  (e.g., for formatting reasonable cross-references; earlier I had to
  remove those that were in the selection help because static text was
  not appropriate for all situations).
- Moved current output format specific methods to be members of this
  class.
- Adjusted using methods to work as before for console output, but did
  not yet implement any additional output formats.  All methods with
  console-specific code now throw a NotImplementedError to make it easy
  to find them once #969 is decided.

Once there has been some discussion on the markup and output formats
in #969, this approach can be extended to actually implement it.
No matter which of the alternatives is chosen, the parts in this commit
are useful, but the decisions made in #969 affect the direction to which
the implementation should be extended.

Prerequisite for #969.

Change-Id: I33cd59e6f3b5450db99e0e1afba4a2d1b9e30e29
22 files changed:
src/gromacs/commandline/cmdlinehelpwriter.cpp
src/gromacs/commandline/cmdlinehelpwriter.h
src/gromacs/commandline/cmdlinemodule.h
src/gromacs/commandline/cmdlinemodulemanager.cpp
src/gromacs/commandline/tests/cmdlinehelpwriter.cpp
src/gromacs/commandline/tests/cmdlinemodulemanager.cpp
src/gromacs/onlinehelp/helpformat.cpp
src/gromacs/onlinehelp/helpformat.h
src/gromacs/onlinehelp/helpmanager.cpp
src/gromacs/onlinehelp/helpmanager.h
src/gromacs/onlinehelp/helptopic.cpp
src/gromacs/onlinehelp/helptopic.h
src/gromacs/onlinehelp/helptopicinterface.h
src/gromacs/onlinehelp/helpwritercontext.cpp [new file with mode: 0644]
src/gromacs/onlinehelp/helpwritercontext.h [new file with mode: 0644]
src/gromacs/onlinehelp/tests/helpmanager.cpp
src/gromacs/selection/parsetree.cpp
src/gromacs/selection/selhelp.cpp
src/gromacs/trajectoryanalysis/cmdlinerunner.cpp
src/gromacs/trajectoryanalysis/cmdlinerunner.h
src/gromacs/trajectoryanalysis/modules.cpp
src/testutils/mock_helptopic.h