Add basic grouping to Options
authorTeemu Murtola <teemu.murtola@gmail.com>
Sun, 19 Jul 2015 06:44:06 +0000 (09:44 +0300)
committerTeemu Murtola <teemu.murtola@gmail.com>
Sat, 25 Jul 2015 09:48:02 +0000 (11:48 +0200)
commitbd8ff104f5c56e7040041a456a349dac48bf60d9
tree36927beb473a2034ea3c0cb209e5e57d005c93e1
parentd140ff68d87ca3c962308fc03dadd4d99cdd9459
Add basic grouping to Options

- Add simple Options::addGroup() to create groups within an option,
  allowing out-of-order creation of options.  In the future, this can
  also be used for improved help output.
- Replace multiple Options objects in trajectory analysis runner with a
  single Options and groups within that container.  This is a
  significant step to make also this code use ICommandLineOptionsModule
  instead of a custom implementation.
- Remove complicated code with some dubious corner-case behavior from
  the command-line parsing code, now that all command-line options are
  in a single Options object.

addSubSection() in Options is now unused, and its general design does
not match that of the other Options code.  Will refactor and/or remove
it separately.

Change-Id: Ifaa28a210b46edc0a2b25e7e5c335f0708f532f8
12 files changed:
src/gromacs/commandline/cmdlineparser.cpp
src/gromacs/commandline/tests/cmdlinehelpwriter.cpp
src/gromacs/commandline/tests/refdata/CommandLineHelpWriterTest_HandlesOptionGroups.xml [new file with mode: 0644]
src/gromacs/options/abstractoption.h
src/gromacs/options/options-impl.h
src/gromacs/options/options.cpp
src/gromacs/options/options.h
src/gromacs/options/optionsassigner.cpp
src/gromacs/options/optionsassigner.h
src/gromacs/options/optionsvisitor.cpp
src/gromacs/options/tests/optionsassigner.cpp
src/gromacs/trajectoryanalysis/cmdlinerunner.cpp