Handle erroneous command line args better
authorMark Abraham <mark.j.abraham@gmail.com>
Wed, 3 Jan 2018 10:35:38 +0000 (11:35 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Wed, 10 Jan 2018 08:47:19 +0000 (09:47 +0100)
commit5577aadf5600f0adfa84a8b58e15007703bfa424
tree7e8ddd6ef63b501252ccd1819b3adaf43e083080
parent24db1d08b5814fc22bde3e48839bfb25e0feb0be
Handle erroneous command line args better

Some gmx modules need to be able to accept non-option arguments, and
some should not. Introduced enough functionality to support such
behaviour, while giving useful error messages in cases where the
command line is merely missing hyphens (which can happen e.g. when
people copy-paste from inconveniently built PDF files for tutorials).
Increased test coverage of relevant cases.

Removed some useless command-line argument strings from test cases
that never needed them.

Also tested some behaviours of handling string options, and renamed
some test input strings to reflect the intent.

Fixes #2153

Change-Id: Icec02ea86a57a8b129a621121518036b9f032078
src/gromacs/commandline/cmdlinehelpmodule.cpp
src/gromacs/commandline/cmdlinemodulemanager.cpp
src/gromacs/commandline/cmdlineparser.cpp
src/gromacs/commandline/cmdlineparser.h
src/gromacs/commandline/pargs.cpp
src/gromacs/commandline/tests/cmdlinemodulemanager.cpp
src/gromacs/commandline/tests/cmdlineparser.cpp
src/gromacs/commandline/tests/pargs.cpp
src/gromacs/energyanalysis/tests/legacyenergy.cpp
src/gromacs/gmxana/tests/gmx_traj.cpp
src/gromacs/gmxana/tests/gmx_trjconv.cpp