From 19843d49c2f99bd78c29e4055bbe90e720bab780 Mon Sep 17 00:00:00 2001 From: smehringer Date: Mon, 16 Mar 2020 10:08:18 +0100 Subject: [PATCH 1/3] [DOC] Use \copydetails to avoid documentation duplication. --- .../argument_parser/detail/format_base.hpp | 37 ++++--------------- .../argument_parser/detail/format_parse.hpp | 36 ++++-------------- 2 files changed, 15 insertions(+), 58 deletions(-) diff --git a/include/seqan3/argument_parser/detail/format_base.hpp b/include/seqan3/argument_parser/detail/format_base.hpp index 3000cb7001..b6db11bc18 100644 --- a/include/seqan3/argument_parser/detail/format_base.hpp +++ b/include/seqan3/argument_parser/detail/format_base.hpp @@ -223,16 +223,7 @@ class format_help_base : public format_base public: /*!\brief Adds a seqan3::print_list_item call to be evaluated later on. - * - * \tparam option_type The type of variable in which to store the given command line argument. - * \tparam validator_type The type of validator applied to the value after parsing. - * - * \param[out] value The variable in which to store the given command line argument. - * \param[in] short_id The short identifier for the option (e.g. 'i'). - * \param[in] long_id The long identifier for the option (e.g. "integer"). - * \param[in] desc The description of the option. - * \param[in] spec Advanced option specification, see seqan3::option_spec. - * \param[in] validator The validator applied to the value after parsing (callable). + * \copydetails seqan3::argument_parser::add_option */ template void add_option(option_type & value, @@ -258,13 +249,9 @@ class format_help_base : public format_base } /*!\brief Adds a seqan3::print_list_item call to be evaluated later on. - * - * \param[in] short_id The short identifier for the flag (e.g. 'i'). - * \param[in] long_id The long identifier for the flag (e.g. "integer"). - * \param[in] desc The description of the flag. - * \param[in] spec Advanced flag specification, see seqan3::option_spec. + * \copydetails seqan3::argument_parser::add_flag */ - void add_flag(bool & /*value*/, + void add_flag(bool & SEQAN3_DOXYGEN_ONLY(value), char const short_id, std::string const & long_id, std::string const & desc, @@ -278,13 +265,7 @@ class format_help_base : public format_base } /*!\brief Adds a seqan3::print_list_item call to be evaluated later on. - * - * \tparam option_type The type of variable in which to store the given command line argument. - * \tparam validator_type The type of validator applied to the value after parsing. - * - * \param[out] value The variable in which to store the given command line argument. - * \param[in] desc The description of the positional option. - * \param[in] validator The validator applied to the value after parsing (callable). + * \copydetails seqan3::argument_parser::add_positional_option */ template void add_positional_option(option_type & value, @@ -371,7 +352,7 @@ class format_help_base : public format_base } /*!\brief Adds a print_section call to parser_set_up_calls. - * \param[in] title The title of the section of the help page. + * \copydetails seqan3::argument_parser::add_section */ void add_section(std::string const & title) { @@ -382,7 +363,7 @@ class format_help_base : public format_base } /*!\brief Adds a print_subsection call to parser_set_up_calls. - * \param[in] title The title of the subsection of the help page. + * \copydetails seqan3::argument_parser::add_subsection */ void add_subsection(std::string const & title) { @@ -393,8 +374,7 @@ class format_help_base : public format_base } /*!\brief Adds a print_line call to parser_set_up_calls. - * \param[in] text The line text to be printed to the help page. - * \param[in] line_is_paragraph True if you want a new line at the end. + * \copydetails seqan3::argument_parser::add_line */ void add_line(std::string const & text, bool line_is_paragraph) { @@ -405,8 +385,7 @@ class format_help_base : public format_base } /*!\brief Adds a seqan3::print_list_item call to parser_set_up_calls. - * \param[in] key The key of the key-value pair list item. - * \param[in] desc The key of the key-value pair list item. + * \copydetails seqan3::argument_parser::add_list_item */ void add_list_item(std::string const & key, std::string const & desc) { diff --git a/include/seqan3/argument_parser/detail/format_parse.hpp b/include/seqan3/argument_parser/detail/format_parse.hpp index fe45d03397..da7f7facaf 100644 --- a/include/seqan3/argument_parser/detail/format_parse.hpp +++ b/include/seqan3/argument_parser/detail/format_parse.hpp @@ -71,23 +71,13 @@ class format_parse : public format_base //!\} /*!\brief Adds an seqan3::detail::get_option call to be evaluated later on. - * - * \tparam option_type The type of variable in which to store the given command line argument. - * \tparam validator_type The type of validator applied to the value after parsing. - * - * \param[out] value The variable in which to store the given command line argument. - * \param[in] short_id The short identifier for the option (e.g. 'i'). - * \param[in] long_id The long identifier for the option (e.g. "integer"). - * \param[in] spec Advanced option specification, see seqan3::option_spec. - * \param[in] validator The validator applied to the value after parsing (callable). - * - * \throws seqan3::design_error + * \copydetails seqan3::argument_parser::add_option */ template void add_option(option_type & value, char const short_id, std::string const & long_id, - std::string const & /*desc*/, + std::string const & SEQAN3_DOXYGEN_ONLY(desc), option_spec const & spec, validator_type && validator) { @@ -98,18 +88,13 @@ class format_parse : public format_base } /*!\brief Adds a get_flag call to be evaluated later on. - * - * \param[out] value The variable in which to store the given command line argument. - * \param[in] short_id The short identifier for the flag (e.g. 'i'). - * \param[in] long_id The long identifier for the flag (e.g. "integer"). - * - * \throws seqan3::design_error + * \copydetails seqan3::argument_parser::add_flag */ void add_flag(bool & value, char const short_id, std::string const & long_id, - std::string const & /*desc*/, - option_spec const & /*spec*/) + std::string const & SEQAN3_DOXYGEN_ONLY(desc), + option_spec const & SEQAN3_DOXYGEN_ONLY(spec)) { flag_calls.push_back([this, &value, short_id, long_id]() { @@ -118,18 +103,11 @@ class format_parse : public format_base } /*!\brief Adds a get_positional_option call to be evaluated later on. - * - * \tparam option_type The type of variable in which to store the given command line argument. - * \tparam validator_type The type of validator applied to the value after parsing. - * - * \param[out] value The variable in which to store the given command line argument. - * \param[in] validator The validator applied to the value after parsing (callable). - * - * \throws seqan3::design_error + * \copydetails seqan3::argument_parser::add_positional_option */ template void add_positional_option(option_type & value, - std::string const & /*desc*/, + std::string const & SEQAN3_DOXYGEN_ONLY(desc), validator_type && validator) { positional_option_calls.push_back([this, &value, validator]() From 982cf423ea585d58729d1109e3c5d84f174800b9 Mon Sep 17 00:00:00 2001 From: smehringer Date: Mon, 16 Mar 2020 10:12:03 +0100 Subject: [PATCH 2/3] [MISC] Add option spec variable for advanced help page information. --- CHANGELOG.md | 10 +++ .../argument_parser/argument_parser.hpp | 27 +++--- .../argument_parser/detail/format_base.hpp | 70 +++++++-------- .../argument_parser/detail/format_parse.hpp | 8 +- .../detail/format_help_test.cpp | 86 +++++++++++++++++++ .../format_parse_validators_test.cpp | 4 +- 6 files changed, 151 insertions(+), 54 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9194ee8ae..a9ff3e7c62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,16 @@ Note that 3.1.0 will be the first API stable release and interfaces in this rele ## New features +#### Argument Parser + +* The following functions accept a `seqan3::argument_parser::option_spec::ADVANCED` to control what is + displayed on the (advanced) help page: + * `seqan3::argument_parser::add_section` + * `seqan3::argument_parser::add_subsection` + * `seqan3::argument_parser::add_line` + * `seqan3::argument_parser::add_list_item` + Note that other `seqan3::argument_parser::option_spec`s like `REQUIRED` are ignored. + #### I/O * The `seqan3::format_fasta` accepts the file extenstion `.fas` as a valid extension for the FASTA format diff --git a/include/seqan3/argument_parser/argument_parser.hpp b/include/seqan3/argument_parser/argument_parser.hpp index 3595e9548b..13f733b338 100644 --- a/include/seqan3/argument_parser/argument_parser.hpp +++ b/include/seqan3/argument_parser/argument_parser.hpp @@ -420,38 +420,45 @@ class argument_parser /*!\brief Adds an help page section to the seqan3::argument_parser. * \param[in] title The title of the section. + * \param[in] spec Whether to always display this section title (seqan3::option_spec::DEFAULT), only when showing + * the advanced help page (seqan3::option_spec::ADVANCED) or never (seqan3::option_spec::HIDDEN). * \details This only affects the help page and other output formats. */ - void add_section(std::string const & title) + void add_section(std::string const & title, option_spec const spec = option_spec::DEFAULT) { - std::visit([&] (auto & f) { f.add_section(title); }, format); + std::visit([&] (auto & f) { f.add_section(title, spec); }, format); } /*!\brief Adds an help page subsection to the seqan3::argument_parser. * \param[in] title The title of the subsection. + * \param[in] spec Whether to always display this subsection title (seqan3::option_spec::DEFAULT), only when showing + * the advanced help page (seqan3::option_spec::ADVANCED) or never (seqan3::option_spec::HIDDEN). * \details This only affects the help page and other output formats. */ - void add_subsection(std::string const & title) + void add_subsection(std::string const & title, option_spec const spec = option_spec::DEFAULT) { - std::visit([&] (auto & f) { f.add_subsection(title); }, format); + std::visit([&] (auto & f) { f.add_subsection(title, spec); }, format); } /*!\brief Adds an help page text line to the seqan3::argument_parser. * \param[in] text The text to print. - * \param[in] line_is_paragraph Whether to insert as paragraph - * or just a line (Default: false). + * \param[in] is_paragraph Whether to insert as paragraph or just a line (Default: false). + * \param[in] spec Whether to always display this line (seqan3::option_spec::DEFAULT), only when showing + * the advanced help page (seqan3::option_spec::ADVANCED) or never (seqan3::option_spec::HIDDEN). * \details * If the line is not a paragraph (false), only one line break is appended, otherwise two line breaks are appended. * This only affects the help page and other output formats. */ - void add_line(std::string const & text, bool line_is_paragraph = false) + void add_line(std::string const & text, bool is_paragraph = false, option_spec const spec = option_spec::DEFAULT) { - std::visit([&] (auto & f) { f.add_line(text, line_is_paragraph); }, format); + std::visit([&] (auto & f) { f.add_line(text, is_paragraph, spec); }, format); } /*!\brief Adds an help page list item (key-value) to the seqan3::argument_parser. * \param[in] key The key of the key-value pair of the list item. * \param[in] desc The value of the key-value pair of the list item. + * \param[in] spec Whether to always display this list item (seqan3::option_spec::DEFAULT), only when showing + * the advanced help page (seqan3::option_spec::ADVANCED) or never (seqan3::option_spec::HIDDEN). * * \details * @@ -465,9 +472,9 @@ class argument_parser * Super important integer for age. *``` */ - void add_list_item(std::string const & key, std::string const & desc) + void add_list_item(std::string const & key, std::string const & desc, option_spec const spec = option_spec::DEFAULT) { - std::visit([&] (auto & f) { f.add_list_item(key, desc); }, format); + std::visit([&] (auto & f) { f.add_list_item(key, desc, spec); }, format); } //!\} diff --git a/include/seqan3/argument_parser/detail/format_base.hpp b/include/seqan3/argument_parser/detail/format_base.hpp index b6db11bc18..12f3afd3b9 100644 --- a/include/seqan3/argument_parser/detail/format_base.hpp +++ b/include/seqan3/argument_parser/detail/format_base.hpp @@ -233,19 +233,11 @@ class format_help_base : public format_base option_spec const & spec, validator_type && validator) { - std::string msg = validator.get_help_page_message(); - - parser_set_up_calls.push_back([this, &value, short_id, long_id, desc, spec, msg] () - { - if (!(spec & option_spec::HIDDEN) && (!(spec & option_spec::ADVANCED) || show_advanced_options)) - derived_t().print_list_item(prep_id_for_help(short_id, long_id) + - " " + option_type_and_list_info(value), - desc + - ((spec & option_spec::REQUIRED) - ? std::string{" "} - : detail::to_string(" Default: ", value, ". ")) + - msg); - }); + std::string id = prep_id_for_help(short_id, long_id) + " " + option_type_and_list_info(value); + std::string info{desc}; + info += ((spec & option_spec::REQUIRED) ? std::string{" "} : detail::to_string(" Default: ", value, ". ")); + info += validator.get_help_page_message(); + store_help_page_element([this, id, info] () { derived_t().print_list_item(id, info); }, spec); } /*!\brief Adds a seqan3::print_list_item call to be evaluated later on. @@ -257,11 +249,8 @@ class format_help_base : public format_base std::string const & desc, option_spec const & spec) { - parser_set_up_calls.push_back([this, short_id, long_id, desc, spec] () - { - if (!(spec & option_spec::HIDDEN) && (!(spec & option_spec::ADVANCED) || show_advanced_options)) - derived_t().print_list_item(prep_id_for_help(short_id, long_id), desc); - }); + std::string id = prep_id_for_help(short_id, long_id); + store_help_page_element([this, id, desc] () { derived_t().print_list_item(id, desc); }, spec); } /*!\brief Adds a seqan3::print_list_item call to be evaluated later on. @@ -354,45 +343,33 @@ class format_help_base : public format_base /*!\brief Adds a print_section call to parser_set_up_calls. * \copydetails seqan3::argument_parser::add_section */ - void add_section(std::string const & title) + void add_section(std::string const & title, option_spec const spec) { - parser_set_up_calls.push_back([this, title] () - { - derived_t().print_section(title); - }); + store_help_page_element([this, title] () { derived_t().print_section(title); }, spec); } /*!\brief Adds a print_subsection call to parser_set_up_calls. * \copydetails seqan3::argument_parser::add_subsection */ - void add_subsection(std::string const & title) + void add_subsection(std::string const & title, option_spec const spec) { - parser_set_up_calls.push_back([this, title] () - { - derived_t().print_subsection(title); - }); + store_help_page_element([this, title] () { derived_t().print_subsection(title); }, spec); } /*!\brief Adds a print_line call to parser_set_up_calls. * \copydetails seqan3::argument_parser::add_line */ - void add_line(std::string const & text, bool line_is_paragraph) + void add_line(std::string const & text, bool is_paragraph, option_spec const spec) { - parser_set_up_calls.push_back([this, text, line_is_paragraph] () - { - derived_t().print_line(text, line_is_paragraph); - }); + store_help_page_element([this, text, is_paragraph] () { derived_t().print_line(text, is_paragraph); }, spec); } /*!\brief Adds a seqan3::print_list_item call to parser_set_up_calls. * \copydetails seqan3::argument_parser::add_list_item */ - void add_list_item(std::string const & key, std::string const & desc) + void add_list_item(std::string const & key, std::string const & desc, option_spec const spec) { - parser_set_up_calls.push_back([this, key, desc] () - { - derived_t().print_list_item(key, desc); - }); + store_help_page_element([this, key, desc] () { derived_t().print_list_item(key, desc); }, spec); } /*!\brief Stores all meta information about the application @@ -452,6 +429,23 @@ class format_help_base : public format_base std::vector command_names{}; //!\brief Whether to show advanced options or not. bool show_advanced_options{true}; + +private: + /*!\brief Adds a function object to parser_set_up_calls **if** the annotation in `spec` does not prevent it. + * \param[in] printer The invokable that, if added to `parser_set_up_calls`, prints information to the help page. + * \param[in] spec The option specification deciding whether to add the information to the help page. + * + * \details + * + * If `spec` equals `seqan3::option_spec::HIDDEN`, the information is never added to the help page. + * If `spec` equals `seqan3::option_spec::ADVANCED`, the information is only added to the help page if + * the advanced help page has been queried on the command line (`show_advanced_options == true`). + */ + void store_help_page_element(std::function printer, option_spec const spec) + { + if (!(spec & option_spec::HIDDEN) && (!(spec & option_spec::ADVANCED) || show_advanced_options)) + parser_set_up_calls.push_back(std::move(printer)); + } }; } // namespace seqan3::detail diff --git a/include/seqan3/argument_parser/detail/format_parse.hpp b/include/seqan3/argument_parser/detail/format_parse.hpp index da7f7facaf..f6e1d32d92 100644 --- a/include/seqan3/argument_parser/detail/format_parse.hpp +++ b/include/seqan3/argument_parser/detail/format_parse.hpp @@ -142,10 +142,10 @@ class format_parse : public format_base // functions are not needed for command line parsing but are part of the format interface. //!\cond - void add_section(std::string const &) {} - void add_subsection(std::string const &) {} - void add_line(std::string const &, bool) {} - void add_list_item(std::string const &, std::string const &) {} + void add_section(std::string const &, option_spec const) {} + void add_subsection(std::string const &, option_spec const) {} + void add_line(std::string const &, bool, option_spec const) {} + void add_list_item(std::string const &, std::string const &, option_spec const) {} //!\endcond //!\brief Checks whether `id` is empty. diff --git a/test/unit/argument_parser/detail/format_help_test.cpp b/test/unit/argument_parser/detail/format_help_test.cpp index d5bde8004a..a2ef20ef1c 100644 --- a/test/unit/argument_parser/detail/format_help_test.cpp +++ b/test/unit/argument_parser/detail/format_help_test.cpp @@ -204,6 +204,92 @@ TEST(help_page_printing, do_not_print_hidden_options) expected | std::views::filter(!seqan3::is_space))); } +TEST(help_page_printing, advanced_options) +{ + int32_t option_value{5}; + bool flag_value{}; + + auto set_up = [&option_value, &flag_value] (seqan3::argument_parser & parser) + { + // default or required information are always displayed + parser.add_section("default section", seqan3::option_spec::REQUIRED); + parser.add_subsection("default subsection", seqan3::option_spec::REQUIRED); // same as DEFAULT + parser.add_option(option_value, 'i', "int", "this is a int option.", seqan3::option_spec::REQUIRED); + parser.add_flag(flag_value, 'g', "goo", "this is a flag.", seqan3::option_spec::REQUIRED); // same as DEFAULT + parser.add_list_item("-s, --some", "list item.", seqan3::option_spec::REQUIRED); // same as DEFAULT + parser.add_line("some line.", true, seqan3::option_spec::REQUIRED); // same as DEFAULT + + // advanced information + parser.add_section("advanced section", seqan3::option_spec::ADVANCED); + parser.add_subsection("advanced subsection", seqan3::option_spec::ADVANCED); + parser.add_option(option_value, 'j', "jnt", "this is a int option.", seqan3::option_spec::ADVANCED); + parser.add_flag(flag_value, 'f', "flag", "this is a flag.", seqan3::option_spec::ADVANCED); + parser.add_list_item("-s, --some", "list item.", seqan3::option_spec::ADVANCED); + parser.add_line("some line.", true, seqan3::option_spec::ADVANCED); + + // hidden information (never displayed, normally used for options not section information) + parser.add_section("hidden section", seqan3::option_spec::HIDDEN); + parser.add_subsection("hidden subsection", seqan3::option_spec::HIDDEN); + parser.add_option(option_value, 'd', "dnt", "hidden option.", seqan3::option_spec::HIDDEN); + parser.add_flag(flag_value, 'l', "lflag", "hidden a flag.", seqan3::option_spec::HIDDEN); + parser.add_list_item("-s, --some", "hidden list item.", seqan3::option_spec::HIDDEN); + parser.add_line("hidden line.", true, seqan3::option_spec::HIDDEN); + }; + + // without -hh, only the non/advanced information are shown + seqan3::argument_parser parser_normal_help{"test_parser", 2, argv1}; + set_up(parser_normal_help); + testing::internal::CaptureStdout(); + EXPECT_EXIT(parser_normal_help.parse(), ::testing::ExitedWithCode(EXIT_SUCCESS), ""); + std_cout = testing::internal::GetCapturedStdout(); + expected = "test_parser" + "===========" + + basic_options_str + + "DEFAULT SECTION\n" + " default subsection\n" + "-i, --int (signed 32 bit integer)\n" + " this is a int option.\n" + "-g, --goo\n" + " this is a flag.\n" + "-s, --some\n" + " list item.\n" + "some line.\n" + + basic_version_str; + EXPECT_TRUE(ranges::equal((std_cout | std::views::filter(!seqan3::is_space)), + expected | std::views::filter(!seqan3::is_space))) << std_cout; + + // with -hh everything is shown + seqan3::argument_parser parser_advanced_help{"test_parser", 2, argv2}; + set_up(parser_advanced_help); + testing::internal::CaptureStdout(); + EXPECT_EXIT(parser_advanced_help.parse(), ::testing::ExitedWithCode(EXIT_SUCCESS), ""); + std_cout = testing::internal::GetCapturedStdout(); + expected = "test_parser" + "===========" + + basic_options_str + + "DEFAULT SECTION\n" + " default subsection\n" + "-i, --int (signed 32 bit integer)\n" + " this is a int option.\n" + "-g, --goo\n" + " this is a flag.\n" + "-s, --some\n" + " list item.\n" + "some line.\n" + "ADVANCED SECTION" + " advanced subsection" + "-j, --jnt (signed 32 bit integer)\n" + " this is a int option. Default: 5.\n" + "-f, --flag\n" + " this is a flag.\n" + "-s, --some\n" + " list item.\n" + "some line.\n"+ + basic_version_str; + EXPECT_TRUE(ranges::equal((std_cout | std::views::filter(!seqan3::is_space)), + expected | std::views::filter(!seqan3::is_space))) << std_cout; +} + enum class foo { one, diff --git a/test/unit/argument_parser/format_parse_validators_test.cpp b/test/unit/argument_parser/format_parse_validators_test.cpp index 9f6d4a4f73..fc9063ef76 100644 --- a/test/unit/argument_parser/format_parse_validators_test.cpp +++ b/test/unit/argument_parser/format_parse_validators_test.cpp @@ -1055,6 +1055,7 @@ TEST(validator_test, chaining_validators) // help page message { + option_value.clear(); const char * argv[] = {"./argument_parser_test", "-h"}; seqan3::argument_parser parser{"test_parser", 2, argv, false}; parser.add_option(option_value, 's', "string-option", "desc", @@ -1064,7 +1065,6 @@ TEST(validator_test, chaining_validators) seqan3::regex_validator{".*"}); testing::internal::CaptureStdout(); - option_value.clear(); EXPECT_EXIT(parser.parse(), ::testing::ExitedWithCode(EXIT_SUCCESS), ""); std::string my_stdout = testing::internal::GetCapturedStdout(); std::string expected = std::string{"test_parser" @@ -1076,7 +1076,7 @@ TEST(validator_test, chaining_validators) " Value must match the pattern '.*'."} + basic_version_str; EXPECT_TRUE(std::ranges::equal((my_stdout | std::views::filter(!seqan3::is_space)), - expected | std::views::filter(!seqan3::is_space))); + expected | std::views::filter(!seqan3::is_space))) << my_stdout; } // chaining with a container option value type From 3ca197e8111018279dea65e691988bd49a0b131c Mon Sep 17 00:00:00 2001 From: smehringer Date: Wed, 18 Mar 2020 07:43:09 +0100 Subject: [PATCH 3/3] [MISC] Remove reference when passing option_spec enum. --- include/seqan3/argument_parser/argument_parser.hpp | 4 ++-- include/seqan3/argument_parser/detail/format_base.hpp | 4 ++-- include/seqan3/argument_parser/detail/format_parse.hpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/seqan3/argument_parser/argument_parser.hpp b/include/seqan3/argument_parser/argument_parser.hpp index 13f733b338..2ec81def68 100644 --- a/include/seqan3/argument_parser/argument_parser.hpp +++ b/include/seqan3/argument_parser/argument_parser.hpp @@ -238,7 +238,7 @@ class argument_parser char const short_id, std::string const & long_id, std::string const & desc, - option_spec const & spec = option_spec::DEFAULT, + option_spec const spec = option_spec::DEFAULT, validator_type validator = validator_type{}) // copy to bind rvalues { if (sub_parser != nullptr) @@ -262,7 +262,7 @@ class argument_parser char const short_id, std::string const & long_id, std::string const & desc, - option_spec const & spec = option_spec::DEFAULT) + option_spec const spec = option_spec::DEFAULT) { verify_identifiers(short_id, long_id); // copy variables into the lambda because the calls are pushed to a stack diff --git a/include/seqan3/argument_parser/detail/format_base.hpp b/include/seqan3/argument_parser/detail/format_base.hpp index 12f3afd3b9..d3982ad438 100644 --- a/include/seqan3/argument_parser/detail/format_base.hpp +++ b/include/seqan3/argument_parser/detail/format_base.hpp @@ -230,7 +230,7 @@ class format_help_base : public format_base char const short_id, std::string const & long_id, std::string const & desc, - option_spec const & spec, + option_spec const spec, validator_type && validator) { std::string id = prep_id_for_help(short_id, long_id) + " " + option_type_and_list_info(value); @@ -247,7 +247,7 @@ class format_help_base : public format_base char const short_id, std::string const & long_id, std::string const & desc, - option_spec const & spec) + option_spec const spec) { std::string id = prep_id_for_help(short_id, long_id); store_help_page_element([this, id, desc] () { derived_t().print_list_item(id, desc); }, spec); diff --git a/include/seqan3/argument_parser/detail/format_parse.hpp b/include/seqan3/argument_parser/detail/format_parse.hpp index f6e1d32d92..46000b3735 100644 --- a/include/seqan3/argument_parser/detail/format_parse.hpp +++ b/include/seqan3/argument_parser/detail/format_parse.hpp @@ -78,7 +78,7 @@ class format_parse : public format_base char const short_id, std::string const & long_id, std::string const & SEQAN3_DOXYGEN_ONLY(desc), - option_spec const & spec, + option_spec const spec, validator_type && validator) { option_calls.push_back([this, &value, short_id, long_id, spec, validator]() @@ -633,7 +633,7 @@ class format_parse : public format_base void get_option(option_type & value, char const short_id, std::string const & long_id, - option_spec const & spec, + option_spec const spec, validator_type && validator) { bool short_id_is_set{get_option_by_id(value, short_id)};