Add input file options that accept missing files
[alexxy/gromacs.git] / src / gromacs / commandline / pargs.cpp
index 83180178c5ba638464250b5faf153757f01999e7..0b3538f395cb29afbd229c532ff8a5abd2f3ff3f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -328,6 +328,7 @@ void OptionsAdapter::filenmToOptions(Options *options, t_filenm *fnm)
     const bool        bOptional = ((fnm->flag & ffOPT)   != 0);
     const bool        bLibrary  = ((fnm->flag & ffLIB)   != 0);
     const bool        bMultiple = ((fnm->flag & ffMULT)  != 0);
+    const bool        bMissing  = ((fnm->flag & ffALLOW_MISSING) != 0);
     const char *const name      = &fnm->opt[1];
     const char *      defName   = fnm->fn;
     int               defType   = -1;
@@ -349,6 +350,7 @@ void OptionsAdapter::filenmToOptions(Options *options, t_filenm *fnm)
                     .legacyType(fnm->ftp).legacyOptionalBehavior()
                     .readWriteFlags(bRead, bWrite).required(!bOptional)
                     .libraryFile(bLibrary).multiValue(bMultiple)
+                    .allowMissing(bMissing)
                     .description(ftp2desc(fnm->ftp)));
 }