[suggestion] Check that `.parse()` is called.

Open
#168 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
cli

Research direction

Locate the parser class, its destructor, and the parse() entry point, then review existing tests for parser lifetime and exception behavior. Done means an unparsed parser raises logic_error with the requested message when destroyed, while a parser that has called parse() does not.

Written by the indexing model from the issue text.

Description

a small convenience feature: it is easy to forget calling .parse(). It would help if the destructor of the parser checks if the function was called and throws a logic_error("You forgot to call .parse()") if it was not the case.

Note, that you explicitly need to mark a destructor as noexcept(false) if you want to throw from it.

Dominant language
C++
Stars
11
Forks
9
Avg merge
2h 33m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from seqan/sharg-parser

All issues in seqan/sharg-parser

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.