-
-
Notifications
You must be signed in to change notification settings - Fork 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
Default template is incompatible with help2man #1432
Comments
But should it be? |
This might be resolved now. Not sure |
@CreepySkeleton I think it makes sense for the default output template to follow a formatting convention so common among Linux commands that a tool was written which assumes it. @Dylan-DPC It's easy to check. Run |
I agree with @ssokolow. But we might also have an option to just not display version and author when |
I'm triaging it for 3.0 because if we won't get to it by then, we won't get to it at all. |
@logansquirel You can try this one next 😄. Really appreciate the contributions. |
I need some help for this issue ! After reading all the discussion and related issues/pull requests, I do not know what I should implement. I spent some time on this issue. I tried to dive into help2man documentation/source code to understand how does it work but I won't be able to understand it deeply. These are some ideas on top of my head:
I'm opened to other ideas, I just want to know clap authors opinion on this issue. |
Bear in mind that the fact that help2man exists speaks to the existence of a formatting convention widespread enough to make it practical. Even if clap doesn't choose to explicitly support help2man, aligning itself with an established formatting convention should be considered. (I'm assuming it's the GNU convention... just like |
I concur with this ! In this case we have to find the convention clap should use. Then I have to find the established convention. The best description I found is directly in man-pages: man-pages @ssokolow If you have other ressources on this convention, can you point me to these ? Did you find how help2man parsed help output ? Is there some convention/well written consensus for help flag output too ? Thanks ! Relevant links:
|
I think we agreed on doing "I add \n to the end of the version string and the beginning of the about string" and that should fix this issue. Don't need to write any new tests either since many existing tests will be testing this anyway. |
@logansquirel I haven't had time to dig deeper, so all I have on hand is:
Barring finding something more definitive for GNU conventions, I'd see how well docopt aligns with help2man heuristics since, if they get along, that'd give you a spec people are familiar with from other contexts. |
Rust Version
Affected Version of clap
2.32.0
Bug or Feature Request Summary
The lack of a blank line between the
<name> <version>
line in the--help
output and the description block causeshelp2man
to mistake the<name> <version>
line for a word-wrapped first line of theabout
orlong_about
string.Expected Behavior Summary
With the example from the README, this is what I get If I add
\n
to the end of theversion
string and the beginning of theabout
string, I get this:Ignore the oddity involving "My".
help2man
assumes that the first word in that line will be the command's name and the rest will be the version string, and that's both easy to accomplish and the default for anyone using StructOpt.(The ideal solution would be to produce an
AUTHORS
section in the help2man output, buthelp2man
is designed by people who probably would see author names in--help
as unthinkably egotistical, so there's no provision for extracting such a section automatically.)Actual Behavior Summary
This is
help2man
's output as rendered byman
:Steps to Reproduce the issue
help2man
(it's in most Linux distro repositories, which makes that part easy)about
orlong_about
text and the stuff above it.help2man -N 'cargo run --' > test.man; man -l test.man
Sample Code or Link to Sample Code
The code from the README which begins with
// (Full example with detailed comments in examples/01b_quick_example.rs)
Debug output
As this appears to be a case of "operating as designed, but the design is flawed", I'll produce debug output on request.
The text was updated successfully, but these errors were encountered: