Skip to content

Extensions with dot don't work in argument parser #2353

@h-2

Description

@h-2

Platform

  • SeqAn version: master from around December
  • Operating system: RHEL 7
  • Compiler: gcc10.2

Description

How to repeat the problem

parser.add_positional_option(p1, "FOO", seqan3::input_file_validator{{"foo.bar"}});

This code is accepted and nothing in the documentation suggests that this doesn't work. But when I pass a file called X.foo.bar to the program, the argument parser throws and says

... the following valid extensions: [foo.bar]. Got ".bar" instead!"

I know that we have special treatment for files now (which is nice but might be better served by a different validator), but having an extension with a dot is quite common, even independent of compression.

Expected behaviour

This should work.

Actual behaviour

It doesn't.

Possible fix

This should be quite simple. Just check if the path ends_with the respective string instead of calling .extension().

Metadata

Metadata

Assignees

Labels

bugfaulty or wrong behaviour of codegood first issueassumes no knowledge over the library

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions