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

Generate Volta man pages #1709

Open
chriskrycho opened this issue Mar 13, 2024 · 0 comments
Open

Generate Volta man pages #1709

chriskrycho opened this issue Mar 13, 2024 · 0 comments

Comments

@chriskrycho
Copy link
Contributor

We do not currently supply man pages for Volta. However, it would be relatively straightforward to implement using the clap_mangen crate, since we already use clap for our CLI parser. If someone wants to implement it, it should be a relatively easy first issue.

For a rough idea of how to implement it, you would want to do roughly what we do in src/command/completions.rs:

  • Add clap_mangen as a dependency for that crate.
  • Add a new man_pages module as a sibling to completions and the others.
  • Define a new clap argument with a pub(crate) struct ManPages.
  • Implement Volta’s Command trait for ManPages, including logging events the same basic way Completionts does (so you will also need to add a new ActivityKind etc.) for it.
  • Use the Man struct from clap_mangen to generate the man pages from the command (crate::cli::Volta::command()).
  • Emit the generated roff to the appropriate location. (You will have to see where that is on a per-OS basis!) One note that adds a small bit of complexity here: there is no “default” place to install it on Windows, as far as I know, but we should presumably still support it for someone who wants to read them there.

(Originally posted as a comment by @chriskrycho in #1708 (comment))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant