Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

argument_parser: unhelpful message if the given options isn't one of enums #2464

Closed
marehr opened this issue Mar 22, 2021 · 0 comments · Fixed by #2465
Closed

argument_parser: unhelpful message if the given options isn't one of enums #2464

marehr opened this issue Mar 22, 2021 · 0 comments · Fixed by #2465
Assignees
Labels
bug faulty or wrong behaviour of code

Comments

@marehr
Copy link
Member

marehr commented Mar 22, 2021

Another problem is that for invalid input values it will already throw before the validator is called.
It will try to look up the invalid string in the enumeration_names and not find it; which results in a throw.
But this is something where we would have to change something in seqan

Originally posted by @eseiler in seqan/iGenVar#78 (comment)

Platform

  • SeqAn version:
  • Operating system:
  • Compiler:

Description

How to repeat the problem

Run this test in the iGenVar project. The problem is the argument 9 for option m, which does not exist.

TEST_F(detect_breakends, test_unknown_argument)
{
    cli_test_result result = execute_app("iGenVar",
                                         "-j", data(default_alignment_long_reads_file_path),
                                         fasta_out_file_path,
                                         "-m 9");
    std::string expected_err
    {
        "[Error] Value parse failed for -m: Argument 9 could not be parsed as type std::string.\n"
    };
    EXPECT_EQ(result.exit_code, 65280);
    EXPECT_EQ(result.out, std::string{});
    EXPECT_EQ(result.err, expected_err);
}

Expected behaviour

The Validator should handle the error message

Actual behaviour

In the iGenVar Project, we found this unhelpful error message:
https://github.com/seqan/iGenVar/pull/91/files#r598704725

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug faulty or wrong behaviour of code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants