Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

jcgruenhage
Copy link
Contributor

@jcgruenhagejcgruenhage commentedAug 31, 2024
edited
Loading

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

image

Nushell

image

Man page

image

@semanticdiff-comSemanticDiff.com
Copy link

semanticdiff-combot commentedAug 31, 2024
edited
Loading

Review changes withSemanticDiff.

Analyzed 3 of 7 files.

Overall, the semantic diff is25% smaller than the GitHub diff.

FilenameStatus
Cargo.lockUnsupported file format
Cargo.tomlUnsupported file format
✔️src/settings/cli.rs9.52% smaller
✔️src/settings/mod.rsAnalyzed
✔️src/bin/server.rs32.0% smaller
docs/mkdocs.ymlUnsupported file format
docs/content/features/man-pages-completions.mdUnsupported file format

@jcgruenhagejcgruenhage marked this pull request as ready for reviewAugust 31, 2024 07:46
@joseluisqjoseluisq added enhancementNew feature or request v2v2 release labelsAug 31, 2024
@jcgruenhagejcgruenhageforce-pushed thegenerate-man-and-completions branch from27788de tod4c32bcCompareAugust 31, 2024 09:56
Copy link
Collaborator

@joseluisqjoseluisq left a 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.

@jcgruenhagejcgruenhageforce-pushed thegenerate-man-and-completions branch 2 times, most recently froma180361 to723ae59CompareSeptember 7, 2024 08:02
Copy link
Collaborator

@joseluisqjoseluisq left a 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 calledman-pages-completions.md in/docs/content/features dir.
Then add afeature 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.

@jcgruenhagejcgruenhageforce-pushed thegenerate-man-and-completions branch from723ae59 to91e731cCompareSeptember 8, 2024 09:12
@jcgruenhage
Copy link
ContributorAuthor

@joseluisq I think I've addressed all your feedback. Can you check again whether you're happy with this as it is?

@joseluisqjoseluisq changed the titlefeat: generate man page and completionsSupport for generating man pages and completionsSep 8, 2024
@joseluisq
Copy link
Collaborator

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 .\completions2024-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

Copy link
Collaborator

@joseluisqjoseluisq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks!

jcgruenhage reacted with rocket emoji
@joseluisqjoseluisq merged commitd567b4e intostatic-web-server:masterSep 8, 2024
35 checks passed
@joseluisqjoseluisq added this to thev2.33.0 milestoneSep 8, 2024
@jcgruenhagejcgruenhage deleted the generate-man-and-completions branchSeptember 8, 2024 19:50
@joseluisq
Copy link
Collaborator

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).

@jcgruenhage FYI if the package gets merged upstream then you probably want to include it in theSWS Installations page as other distros, just feel free to open a docs PR.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@joseluisqjoseluisqjoseluisq approved these changes

Assignees
No one assigned
Labels
enhancementNew feature or requestv2v2 release
Projects
None yet
Milestone
v2.33.0
Development

Successfully merging this pull request may close these issues.

2 participants
@jcgruenhage@joseluisq

[8]ページ先頭

©2009-2025 Movatter.jp