-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix: Compatibility with help2man #2369
Conversation
While editing this pull request I noted that in the man page, the
if we compare It seems, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Some minor things.
Change default help template: - The new template introduce new lines before and after author/about sections. - Add help template placeholders: - about-section - author-section - Documentation of new placeholders in clap::App::help_template - Update all unit tests by incorporating new lines
@pksunkara Feel free to point me to other issues that need my contributions. |
When we got clap-rs#3193, we decided in clap-rs#3196 that `--help` will give a summary for other commands (`subcmd --help` in this case) but not show the long version of the output for that other command. Now with clap-rs#3215, I think the case is similar for `--help` not showing the long version but instead preferring the short version and encouraging people to run `--version`. Originally. clap only showed the short version or nothing. This was changed in clap-rs#2369 without fanfare to prefer the long version over short. Now are we preferring short version over the long version always, just like all other help. Fixes clap-rs#3215
Fix compatibility with help2man output (see #1432)
The new template introduce new lines before and after
author/about sections.
about-section
author-section
clap::App::help_template
Closes #1432
Issue
When help2man parses standard clap help template, the generated man page unwraps
{binary_name} {version} {author} {about}
placeholders.Source code
The
main.rs
source file:With version
3.0.0-beta.2
The man page:
Note the description in the man page.
With this pull request
The man page:
Note:
--help
output and it is the same for-h
flagversion
output is unchanged.PP
)Solution
Following changes were included in this pull request:
from:
to
Following help template placeholders were added and documented during development:
{author-section}
{about-section}
All unit tests relying on
--help
format were edited to include new lines.