@@ -394,14 +394,22 @@ parseCommandLine(LambdaOptions & options, int argc, char const ** argv)
394394 " with comments, .m0 is pairwise format)." ,
395395 ArgParseArgument::OUTPUT_FILE ,
396396 " OUT" ));
397- CharString exts = concat (getFileExtensions (BlastTabularFileOut<>()), ' ' );
398- appendValue (exts, ' ' );
399- append (exts, concat (getFileExtensions (BlastReportFileOut<>()), ' ' ));
400- appendValue (exts, ' ' );
401- append (exts, concat (getFileExtensions (BamFileOut ()), ' ' ));
402- // TODO remove .sam.bam, .sam.vcf.gz, .sam.tbi
403-
404- setValidValues (parser, " output" , toCString (exts));
397+ auto exts = getFileExtensions (BlastTabularFileOut<>());
398+ append (exts, getFileExtensions (BlastReportFileOut<>()));
399+ append (exts, getFileExtensions (BamFileOut ()));
400+ CharString extsConcat;
401+ // remove .sam.bam, .sam.vcf.gz, .sam.tbi
402+ for (auto const & ext : exts)
403+ {
404+ if ((!endsWith (ext, " .bam" ) || startsWith (ext, " .bam" )) &&
405+ (!endsWith (ext, " .vcf.gz" )) &&
406+ (!endsWith (ext, " .sam.tbi" )))
407+ {
408+ append (extsConcat, ext);
409+ appendValue (extsConcat, ' ' );
410+ }
411+ }
412+ setValidValues (parser, " output" , toCString (extsConcat));
405413 setDefaultValue (parser, " output" , " output.m8" );
406414
407415 addOption (parser, ArgParseOption (" oc" , " output-columns" ,
0 commit comments