-
-
Notifications
You must be signed in to change notification settings - Fork 94
Support for generating man pages and completions #475
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
Support for generating man pages and completions #475
Conversation
Review changes with SemanticDiff. Analyzed 3 of 7 files. Overall, the semantic diff is 25% smaller than the GitHub diff.
|
27788de
to
d4c32bc
Compare
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.
I like the idea. I left a few suggestions and a question to get your input about.
a180361
to
723ae59
Compare
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.
It looks fine to me I just left a few minor improvements to do.
Just the last thing to do is create a feature page called man-pages-completions.md
in /docs/content/features
dir.
Then add a feature entry in the docs config file /docs/mkdocs.yml
below the last entry.
Please mention in the docs how to use the new subcommand and what can be generated for the three cases.
After that, we should be able to merge.
723ae59
to
91e731c
Compare
@joseluisq I think I've addressed all your feedback. Can you check again whether you're happy with this as it is? |
I also fixed the log info. $ .\static-web-server.exe generate .
2024-09-08T19:01:16.740824Z INFO static_web_server::info: wrote completions to .\completions
2024-09-08T19:01:16.757544Z INFO static_web_server::info: wrote man pages to .\man /static-web-server generate --completions .`
2024-09-08T19:03:46.665862Z INFO static_web_server::info: wrote completions to ./completions |
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.
Thanks!
@jcgruenhage FYI if the package gets merged upstream then you probably want to include it in the SWS Installations page as other distros, just feel free to open a docs PR. |
Description
This adds a way to generate completions and man pages so that distro packagers can ship them.
Instead of doing it based on an env var, which others are doing in f.ex. https://codeberg.org/openpgp-card/openpgp-card-tools/src/branch/main/src/oct.rs#L34-L56, it would also be possible to add a subcommand or a special command line flag, like other are doing in f.ex. https://github.com/orhun/git-cliff/blob/v2.4.0/git-cliff/src/bin/mangen.rs
Related Issue
I have not opened an issue about this. The change is fairly trivial though. If I really need to open an issue, I can do that, but I don't really see the purpose of it.
Motivation and Context
I have written this patch while packaging static-web-server for Chimera Linux, and it was (rightfully) pointed out that this patch should go upstream: chimera-linux/cports#2818 (review).
How Has This Been Tested?
A slightly different version of this patch has been tested in the cports PR linked above.
Screenshots (if appropriate):
Shell Completions
Fish
Nushell
Man page