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

[modular] Decouple help format from help generation #2914

Open
2 tasks done
epage opened this issue Oct 19, 2021 · 3 comments
Open
2 tasks done

[modular] Decouple help format from help generation #2914

epage opened this issue Oct 19, 2021 · 3 comments
Assignees
Labels
A-help Area: documentation, including docs.rs, readme, examples, etc... C-enhancement Category: Raise on the bar on expectations

Comments

@epage
Copy link
Member

epage commented Oct 19, 2021

Please complete the following tasks

  • I have searched the discussions
  • I have searched the existing issues

Clap Version

master

Describe your use case

For manpage generation (#552), md generation, or other output formats, it would help if we provided a way to reuse a lot of what is included in the help generation which would reduce overall bloat (#1384)

Describe the solution you'd like

  1. Pull out a usage and help generation API
  2. Split help generation in two, one that gathers what should be included and in what order from the actual --help layout
  3. Expose the "gather" side of this as its own API for people to plug into.

Alternatives, if applicable

No response

Additional Context

No response

@epage epage self-assigned this Oct 19, 2021
epage pushed a commit that referenced this issue Dec 7, 2021
Until we have a modular help generator that can be configured and/or
authored by the users themselves as part of #2914, we will provide the
flexibility of turning off colored help messages but still wanting
colored error messages.

This flexibility was available before #2845 and @dbrgn immediately
noticed it and requested it back to which I agree. This was also
suggested by Josh in
[here](#2806 (comment))
@epage epage added C-enhancement Category: Raise on the bar on expectations A-help Area: documentation, including docs.rs, readme, examples, etc... and removed T: new feature labels Dec 8, 2021
@epage epage added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Dec 13, 2021
epage pushed a commit that referenced this issue Jan 28, 2022
This is an initial implementation with plenty of room to grow, including
- Allowing pulling out a subset of the generated man page for greater customization
- Subcommand handling
- Extra sections
- Consolidate argument formatter after #2914

Fixes #552
@epage epage removed the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Feb 28, 2023
@fhennig
Copy link

fhennig commented Dec 25, 2023

Hey! I just stumbled on this feature and I'm interested in using it. I see loads of referenced PRs, would it be possible to give an update on this? Is it being worked towards? Just curious, thanks for all the work on this great library! Cheers

@epage
Copy link
Member Author

epage commented Dec 27, 2023

The big challenge is with designing the APIs. The issue to watch will be #5236 as that allow us to define a subset of the API. We can then open things up under unstable- features for more iteration and experimentation.

@fhennig
Copy link

fhennig commented Dec 29, 2023

Ok great! thanks for letting me know, I'll keep an eye on it. I'm interested in this for generating adoc documentation for our commandline tools.

@epage epage mentioned this issue Oct 18, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-help Area: documentation, including docs.rs, readme, examples, etc... C-enhancement Category: Raise on the bar on expectations
Projects
None yet
Development

No branches or pull requests

2 participants