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

Unclear how to handle subcommands with clap_man #3365

Open
2 tasks done
epage opened this issue Jan 28, 2022 · 5 comments
Open
2 tasks done

Unclear how to handle subcommands with clap_man #3365

epage opened this issue Jan 28, 2022 · 5 comments
Labels
A-man Area: man generator C-bug Category: Updating dependencies S-waiting-on-design Status: Waiting on user-facing design to be resolved before implementing

Comments

@epage
Copy link
Member

epage commented Jan 28, 2022

Please complete the following tasks

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

Rust Version

rustc 1.57.0 (f1edd0429 2021-11-29)

Clap Version

v3.0.6

Minimal reproducible code

TBD

Steps to reproduce the bug with the above code

TBD

Actual Behaviour

We show a list of subcommand man apges

Expected Behaviour

TBD

Additional Context

Split out of #3174

#1334 is relevant

Debug Output

No response

@epage epage added C-bug Category: Updating dependencies S-waiting-on-design Status: Waiting on user-facing design to be resolved before implementing A-man Area: man generator labels Jan 28, 2022
@sondr3
Copy link
Contributor

sondr3 commented Jan 29, 2022

For some design "inspiration" on how to lay it out, cabal (cargo for Haskell) has everything in a single, gigantic document while cargo and git lists the available subcommands and where to find them. I highly prefer the latter approach, but it shouldn't be too hard to support both.

@epage
Copy link
Member Author

epage commented Jan 29, 2022

In general, clap behaves more like most of git. The linked issue (#1334) is about offering it to work more like git stash's subcommands.

Its also something we'd want to have an example for to help show how to go about it and to verify we have the full experience worked out,.

@gibfahn
Copy link
Contributor

gibfahn commented Jun 15, 2022

Wanted to link the only example I've found (maybe I missed an obvious one) of a way to handle subcommand man page generation:

https://github.com/CKingX/ddrescue_error_mapping/blob/05899edbe60c0ee6cfdda70aa6379161d2fb1390/build.rs#L20-L38

@sunshowers
Copy link
Contributor

@gibfahn for cargo-nextest I tried that approach but encountered #3869 unfortunately.

@nihaals
Copy link
Contributor

nihaals commented Nov 23, 2022

It would be nice if there was a way to switch between referencing pages for subcommands and including them in the same page (as either an argument to Man::render() or a different method) so you could switch between the two approaches (like cabal and git as mentioned above), as in some contexts having a single page might fit better. It would also provide an immediate workaround for #3603 where a different API wouldn't need to be worked on yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-man Area: man generator C-bug Category: Updating dependencies S-waiting-on-design Status: Waiting on user-facing design to be resolved before implementing
Projects
None yet
Development

No branches or pull requests

5 participants