More elaborate default handling for FileNameOption
authorTeemu Murtola <teemu.murtola@gmail.com>
Mon, 5 May 2014 18:33:27 +0000 (21:33 +0300)
committerTeemu Murtola <teemu.murtola@gmail.com>
Sat, 17 May 2014 14:08:47 +0000 (16:08 +0200)
commit7ddd7bff0de93980324ab90768adf96c6791c5d9
treec37c82f1b8207c3e7779b60110064bd26d143d10
parentaf7d327e5912dfb7a39e661181713529a9dfc6f5
More elaborate default handling for FileNameOption

- FileNameOption now prefers existing files when completing the default
  basename to a full filename for input options, like t_filenm parsing
  does.
- Add FileNameOptionManager that allows interaction between different
  file-related options.  Use it to add support for -deffnm-like option
  to set a default base name for all FileNameOptions.

To do the above, and make the -deffnm option independent from the
command line order, the default file names are now handled during
Options::finish().  So there are cases when the value returned by a file
name option changes after this call.

Change-Id: I73d3badae5409e9f066f06dec307b2c10ac89bfd
src/gromacs/options.h
src/gromacs/options/CMakeLists.txt
src/gromacs/options/filenameoption.cpp
src/gromacs/options/filenameoption.h
src/gromacs/options/filenameoptionmanager.cpp [new file with mode: 0644]
src/gromacs/options/filenameoptionmanager.h [new file with mode: 0644]
src/gromacs/options/filenameoptionstorage.h
src/gromacs/options/tests/filenameoption.cpp