Skip to content

Commit

Permalink
[MISC] deprecate seqan3::argument_parser constructor (#2463)
Browse files Browse the repository at this point in the history
* [MISC] deprecate seqan3::argument_parser constructor

This PR re-introduces a deleted constructor (change made in
6d2e763) and properly deprecates it.

This makes the upgrade-path from 3.0.2 to 3.0.3 easier.

* Apply suggestions from code review

Co-authored-by: Enrico Seiler <eseiler@users.noreply.github.com>

Co-authored-by: Enrico Seiler <eseiler@users.noreply.github.com>
  • Loading branch information
marehr and eseiler committed Mar 22, 2021
1 parent 37edff0 commit d7de7a5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ If possible, provide tooling that performs the changes, e.g. a shell-script.

#### Argument Parser

* The `seqan3::argument_parser` constructor was changed to accept a strong-type `seqan3::update_notifications::(on|off)`
instead of a simple bool (which was subject to unexpected implicit conversion)
([\#2180](https://github.com/seqan/seqan3/pull/2180)).
* We expanded the `seqan3::output_file_validator`, with a parameter `seqan3::output_file_open_options` to allow overwriting
output files ([\#2009](https://github.com/seqan/seqan3/pull/2009)).
* The `seqan3::argument_parser` has a new member function `seqan3::argument_parser::is_option_set` that
Expand Down
19 changes: 19 additions & 0 deletions include/seqan3/argument_parser/argument_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,25 @@ class argument_parser
argument_parser(argument_parser &&) = default; //!< Defaulted.
argument_parser & operator=(argument_parser &&) = default; //!< Defaulted.

#ifdef SEQAN3_DEPRECATED_310
//!\deprecated Please use seqan3::update_notifications::on or seqan3::update_notifications::off for `version_updates`.
SEQAN3_DEPRECATED_310
argument_parser(std::string const app_name,
int const argc,
char const * const * const argv,
bool version_updates,
std::vector<std::string> subcommands = {}) :
argument_parser
{
app_name,
argc,
argv,
version_updates ? update_notifications::on : update_notifications::off,
subcommands
}
{}
#endif // SEQAN3_DEPRECATED_310

/*!\brief Initializes an seqan3::argument_parser object from the command line arguments.
*
* \param[in] app_name The name of the app that is displayed on the help page.
Expand Down

1 comment on commit d7de7a5

@vercel
Copy link

@vercel vercel bot commented on d7de7a5 Mar 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.