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

[FEATURE] Adding information only to the advanced help pages is now possible. #1652

Merged
merged 3 commits into from
Mar 25, 2020

Conversation

smehringer
Copy link
Member

Fixes #1175

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_specs like REQUIRED are ignored.

@smehringer smehringer requested review from a team and joergi-w and removed request for a team March 17, 2020 06:22
Copy link
Member

@joergi-w joergi-w left a comment

Choose a reason for hiding this comment

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

Looks good! Just a few namespace issues, because we force seqan3:: prefix now, right?

test/unit/argument_parser/detail/format_help_test.cpp Outdated Show resolved Hide resolved
test/unit/argument_parser/detail/format_help_test.cpp Outdated Show resolved Hide resolved
test/unit/argument_parser/detail/format_help_test.cpp Outdated Show resolved Hide resolved
@smehringer smehringer added this to ⏳ In Progress in Module: Argument Parser via automation Mar 17, 2020
Copy link
Member

@joergi-w joergi-w left a comment

Choose a reason for hiding this comment

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

Thank you!

@codecov
Copy link

codecov bot commented Mar 17, 2020

Codecov Report

Merging #1652 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1652      +/-   ##
==========================================
+ Coverage   97.66%   97.67%   +0.01%     
==========================================
  Files         236      237       +1     
  Lines        8988     9045      +57     
==========================================
+ Hits         8778     8835      +57     
  Misses        210      210              
Impacted Files Coverage Δ
include/seqan3/argument_parser/argument_parser.hpp 98.54% <100.00%> (ø)
...lude/seqan3/argument_parser/detail/format_base.hpp 88.52% <100.00%> (-0.79%) ⬇️
...ude/seqan3/argument_parser/detail/format_parse.hpp 96.58% <100.00%> (ø)
include/seqan3/io/sequence_file/input.hpp 100.00% <0.00%> (ø)
include/seqan3/io/alignment_file/input.hpp 100.00% <0.00%> (ø)
include/seqan3/io/sequence_file/output.hpp 100.00% <0.00%> (ø)
include/seqan3/io/structure_file/input.hpp 100.00% <0.00%> (ø)
include/seqan3/io/alignment_file/output.hpp 100.00% <0.00%> (ø)
include/seqan3/io/structure_file/output.hpp 100.00% <0.00%> (ø)
include/seqan3/search/algorithm/detail/search.hpp 100.00% <0.00%> (ø)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 372911c...3ca197e. Read the comment docs.

@smehringer smehringer requested a review from rrahn March 17, 2020 08:32
Copy link
Contributor

@rrahn rrahn left a comment

Choose a reason for hiding this comment

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

In general looks good to me. Some small changes I'd like to suggest.

@smehringer smehringer requested a review from rrahn March 18, 2020 09:21
Copy link
Contributor

@rrahn rrahn left a comment

Choose a reason for hiding this comment

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

I have additional minor suggestions.

@smehringer smehringer requested a review from rrahn March 19, 2020 14:20
@rrahn
Copy link
Contributor

rrahn commented Mar 19, 2020

something broke?

Copy link
Contributor

@rrahn rrahn left a comment

Choose a reason for hiding this comment

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

looks fine. Some minor naming suggestions. And please have a look at the failing tests. Many thanks.

* \param[in] spec The option specification.
* \returns `true` if the information annotated with `spec` should be added to the help page, `false` otherwise.
/*!\brief Adds a function object to parser_set_up_calls **if** the annotation in `spec` does not prevent it.
* \param[in] fun The function object that, if added to parser_set_up_calls, prints information to the help page.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* \param[in] fun The function object that, if added to parser_set_up_calls, prints information to the help page.
* \param[in] print_callback The invocable that, if added to `parser_set_up_calls`, prints information to the help page.

Copy link
Member Author

@smehringer smehringer Mar 19, 2020

Choose a reason for hiding this comment

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

The name print_callback does not tell me much. I don't know what you are expressing by callback?
would printer be fine? :D

Copy link
Member Author

Choose a reason for hiding this comment

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

@rrahn ping

Copy link
Contributor

Choose a reason for hiding this comment

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

In computer programming, a callback, also known as a "call-after"[1] function, is any executable code that is passed as an argument to other code; that other code is expected to call back (execute) the argument at a given time.

So that's why callback tells me what it is. Since it is documented as invocable it would be fine for me to call it printer.

@rrahn
Copy link
Contributor

rrahn commented Mar 24, 2020

Do you want me to squash or do you fix up the commit history?

@smehringer
Copy link
Member Author

I cleaned the commit history

@smehringer smehringer merged commit d374879 into seqan:master Mar 25, 2020
Module: Argument Parser automation moved this from ⏳ In Progress to 🍻 Done Mar 25, 2020
@smehringer smehringer deleted the argument_parser_misc branch May 29, 2020 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

ArgParser: Don't show headers for empty sections.
3 participants