Replace all command line parsing with Options
authorTeemu Murtola <teemu.murtola@gmail.com>
Tue, 6 May 2014 03:32:47 +0000 (06:32 +0300)
committerDavid van der Spoel <davidvanderspoel@gmail.com>
Sat, 7 Jun 2014 12:49:11 +0000 (14:49 +0200)
commiteb9a45e5088458dadf5dd4dc47c7a38213788d11
treecc592bb3dcea147eda05e41f47f82acef372c498
parentf5a0474fe484723243ca14ba27633404795ee42a
Replace all command line parsing with Options

- Add a more elaborate conversion mechanism in pargs.cpp, that also
  converts the values back for option types where the C and C++ types do
  not match.
- Arguments added in parse_common_args() no longer need to go through
  the conversion, but instead use Options mechanisms directly.
- Time unit option is now handled through TimeUnitManager.  It requires
  extra refactoring to make oenv to use this also internally, but that
  would remove more duplication.
- A few more tweaks to FileNameOption behavior.  The implementation is
  not perhaps the cleanest currently, but refactoring will follow.

There can be some glitches in uncommon cases or on error paths in the
new approach, but in general, error handling should be much more
user-friendly.  Part of future FileNameOption refactoring aims to
improve this part futher.  The only way to find issues is for people to
actually use the new code.

Change-Id: Iea51bd379a3cd04ad62ac76822fcb9f4251ee9d4
src/gromacs/commandline/pargs.cpp
src/gromacs/commandline/tests/pargs.cpp
src/gromacs/fileio/filenm.c
src/gromacs/fileio/filenm.h
src/gromacs/options/filenameoption.cpp
src/gromacs/options/filenameoption.h
src/gromacs/options/timeunitmanager.cpp
src/gromacs/options/timeunitmanager.h