Fine-tuning for FileNameOption.
authorTeemu Murtola <teemu.murtola@gmail.com>
Sun, 9 Sep 2012 17:28:26 +0000 (20:28 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Tue, 25 Sep 2012 01:47:41 +0000 (03:47 +0200)
commitec1b4a8ff3ba553ff382754222acfb23f2b1338a
treefa9d468f0d60cac9db844bd44ccef34f3f92bc84
parentccb2b41578c6b1beb359e250b9ec4e20fae87d39
Fine-tuning for FileNameOption.

- Change behavior of required options with default values such that the
  default value is now used without an error if the option is not
  provided.  This is how it used to work with file name options.  For
  most other cases, this combination doesn't make much sense, but
  changed it such that it works consistently for all cases.
- Add FileNameOption::defaultBasename() as a more intuitive interface
  for providing a default for file name options.  The name makes it
  clear that no extension is expected, and the option also transparently
  treats required/optional arguments without the user needing to
  understand the difference between defaultValue() and
  defaultValueIfSet().

Closes #642; there is still some things to be improved, but should now
provide about the same features and about the same input options as
the old t_filenm-based system.

Change-Id: Ibcaf0667180e0b24b08604869d855baf23476681
14 files changed:
share/template/template.cpp
src/gromacs/commandline/tests/cmdlinehelpwriter.cpp
src/gromacs/options/abstractoption.cpp
src/gromacs/options/abstractoption.h
src/gromacs/options/filenameoption.cpp
src/gromacs/options/filenameoption.h
src/gromacs/options/optionflags.h
src/gromacs/options/optionstoragetemplate.h
src/gromacs/options/tests/filenameoption.cpp
src/gromacs/options/tests/optionsassigner.cpp
src/gromacs/trajectoryanalysis/modules/angle.cpp
src/gromacs/trajectoryanalysis/modules/distance.cpp
src/gromacs/trajectoryanalysis/modules/select.cpp
src/gromacs/trajectoryanalysis/runnercommon.cpp