@@ -151,12 +151,14 @@ class ArgParseArgument
151151 enum ArgumentType
152152 {
153153 // argument is
154- STRING, // .. a string
155- INTEGER, // .. an integer
156- INT64, // .. a 64 bit integer
157- DOUBLE, // .. a float
158- INPUTFILE, // .. an inputfile (implicitly also a string)
159- OUTPUTFILE // .. an outputfile (implicitly also a string)
154+ STRING, // .. a string
155+ INTEGER, // .. an integer
156+ INT64, // .. a 64 bit integer
157+ DOUBLE, // .. a float
158+ INPUTFILE, // .. an inputfile (implicitly also a string)
159+ OUTPUTFILE, // .. an outputfile (implicitly also a string)
160+ INPUTPREFIX, // .. an inputprefix (implicitly also a string)
161+ OUTPUTPREFIX // .. an outoutprefix (implicitly also a string)
160162 };
161163
162164
@@ -256,6 +258,14 @@ inline std::string _typeToString(ArgParseArgument const & me)
256258 typeName = " outputfile" ;
257259 break ;
258260
261+ case ArgParseArgument::INPUTPREFIX:
262+ typeName = " inputprefix" ;
263+ break ;
264+
265+ case ArgParseArgument::OUTPUTPREFIX:
266+ typeName = " outputprefix" ;
267+ break ;
268+
259269 default :
260270 typeName = " unknown" ;
261271 break ;
@@ -333,7 +343,9 @@ inline bool isStringArgument(ArgParseArgument const & me)
333343{
334344 return (me._argumentType == ArgParseArgument::STRING) ||
335345 (me._argumentType == ArgParseArgument::INPUTFILE) ||
336- (me._argumentType == ArgParseArgument::OUTPUTFILE);
346+ (me._argumentType == ArgParseArgument::OUTPUTFILE) ||
347+ (me._argumentType == ArgParseArgument::INPUTPREFIX) ||
348+ (me._argumentType == ArgParseArgument::OUTPUTPREFIX) ;
337349}
338350
339351// ----------------------------------------------------------------------------
@@ -425,7 +437,7 @@ inline bool isInt64Argument(ArgParseArgument const & me)
425437..class:Class.ArgParseArgument
426438..summary:Returns whether the argument is a double.
427439..cat:Miscellaneous
428- ..signature:isListArgument (argument)
440+ ..signature:isDoubleArgument (argument)
429441..param.argument:The @Class.ArgParseArgument@ object.
430442...type:Class.ArgParseArgument
431443..returns:$true$ if the argument argument is a double argument.
@@ -445,7 +457,7 @@ inline bool isDoubleArgument(ArgParseArgument const & me)
445457/* !
446458 * @fn ArgParseArgument#isInputFileArgument
447459 * @headerfile <seqan/arg_parse.h>
448- * @brief Returns whether the argument is a input file integer .
460+ * @brief Returns whether the argument is a input file.
449461 *
450462 * @signature bool isInputFileArgument(arg);
451463 *
@@ -459,7 +471,7 @@ inline bool isDoubleArgument(ArgParseArgument const & me)
459471..class:Class.ArgParseArgument
460472..summary:Returns whether the argument is an input file.
461473..cat:Miscellaneous
462- ..signature:isListArgument (argument)
474+ ..signature:isOutputFileArgument (argument)
463475..param.argument:The @Class.ArgParseArgument@ object.
464476...type:Class.ArgParseArgument
465477..returns:$true$ if the argument argument is an input file argument.
@@ -479,7 +491,7 @@ inline bool isInputFileArgument(ArgParseArgument const & me)
479491/* !
480492 * @fn ArgParseArgument#isOutputFileArgument
481493 * @headerfile <seqan/arg_parse.h>
482- * @brief Returns whether the argument is a output file integer .
494+ * @brief Returns whether the argument is a output file.
483495 *
484496 * @signature bool isOutputFileArgument(arg);
485497 *
@@ -493,7 +505,7 @@ inline bool isInputFileArgument(ArgParseArgument const & me)
493505..class:Class.ArgParseArgument
494506..summary:Returns whether the argument is an output file.
495507..cat:Miscellaneous
496- ..signature:isListArgument (argument)
508+ ..signature:isOutputFileArgument (argument)
497509..param.argument:The @Class.ArgParseArgument@ object.
498510...type:Class.ArgParseArgument
499511...type:Class.ArgParseOption
@@ -507,6 +519,76 @@ inline bool isOutputFileArgument(ArgParseArgument const & me)
507519 return me._argumentType == ArgParseArgument::OUTPUTFILE;
508520}
509521
522+ // ----------------------------------------------------------------------------
523+ // Function isOutputPrefixArgument()
524+ // ----------------------------------------------------------------------------
525+
526+ /* !
527+ * @fn ArgParseArgument#isOutputPrefixArgument
528+ * @headerfile <seqan/arg_parse.h>
529+ * @brief Returns whether the argument is an output prefix.
530+ *
531+ * @signature bool isOutputPrefixArgument(arg);
532+ *
533+ * @param arg The ArgParseArgument to query.
534+ *
535+ * @return bool <tt>true</tt> if it is an output prefix argument, <tt>false</tt> otherwise.
536+ */
537+
538+ /* *
539+ .Function.isOutputPrefixArgument
540+ ..class:Class.ArgParseArgument
541+ ..summary:Returns whether the argument is an output file.
542+ ..cat:Miscellaneous
543+ ..signature:isOutputPrefixArgument(argument)
544+ ..param.argument:The @Class.ArgParseArgument@ object.
545+ ...type:Class.ArgParseArgument
546+ ...type:Class.ArgParseOption
547+ ..returns:$true$ if the argument argument is an output file argument.
548+ ..see:Memfunc.ArgParseArgument#ArgParseArgument.param.argumentType
549+ ..include:seqan/arg_parse.h
550+ */
551+
552+ inline bool isOutputPrefixArgument (ArgParseArgument const & me)
553+ {
554+ return me._argumentType == ArgParseArgument::OUTPUTPREFIX;
555+ }
556+
557+ // ----------------------------------------------------------------------------
558+ // Function isOutputFileArgument()
559+ // ----------------------------------------------------------------------------
560+
561+ /* !
562+ * @fn ArgParseArgument#isInputPrefixArgument
563+ * @headerfile <seqan/arg_parse.h>
564+ * @brief Returns whether the argument is an input prefix argument.
565+ *
566+ * @signature bool isInputPrefixArgument(arg);
567+ *
568+ * @param arg The ArgParseArgument to query.
569+ *
570+ * @return bool <tt>true</tt> if it is an input prefix argument, <tt>false</tt> otherwise.
571+ */
572+
573+ /* *
574+ .Function.isInputPrefixArgument
575+ ..class:Class.ArgParseArgument
576+ ..summary:Returns whether the argument is an output file.
577+ ..cat:Miscellaneous
578+ ..signature:isInputPrefixArgument(argument)
579+ ..param.argument:The @Class.ArgParseArgument@ object.
580+ ...type:Class.ArgParseArgument
581+ ...type:Class.ArgParseOption
582+ ..returns:$true$ if the argument argument is an input prefix argument.
583+ ..see:Memfunc.ArgParseArgument#ArgParseArgument.param.argumentType
584+ ..include:seqan/arg_parse.h
585+ */
586+
587+ inline bool isInputPrefixArgument (ArgParseArgument const & me)
588+ {
589+ return me._argumentType == ArgParseArgument::INPUTPREFIX;
590+ }
591+
510592// ----------------------------------------------------------------------------
511593// Function getArgumentLabel()
512594// ----------------------------------------------------------------------------
@@ -548,6 +630,8 @@ inline std::string const getArgumentLabel(ArgParseArgument const & me)
548630 std::string baseLabel = " " ;
549631 if (isInputFileArgument (me) || isOutputFileArgument (me))
550632 baseLabel = " FILE" ;
633+ else if (isInputPrefixArgument (me) || isOutputPrefixArgument (me))
634+ baseLabel = " PREFIX" ;
551635 else if (isStringArgument (me))
552636 baseLabel = " STR" ;
553637 else if (isIntegerArgument (me) || isDoubleArgument (me))
@@ -893,7 +977,8 @@ inline void _checkStringRestrictions(ArgParseArgument const & me, std::string va
893977{
894978 typedef std::vector<std::string>::const_iterator TVectorIterator;
895979
896- if (!empty (me.validValues ))
980+ // we only check valid values for files and string arguments, but not for prefix arguments
981+ if (!empty (me.validValues ) && !(isInputPrefixArgument (me) || isOutputPrefixArgument (me)))
897982 {
898983 bool isContained = false ;
899984 for (TVectorIterator validValue = me.validValues .begin ();
0 commit comments