shssoichiro / oxipng

Multithreaded PNG optimizer written in Rust
MIT License
2.95k stars 124 forks source link

Feature/manpage #596

Closed andrews05 closed 8 months ago

andrews05 commented 8 months ago

This PR adds a build script to generate a man page using clap_mangen, as per this example: https://github.com/sondr3/clap-man-example/blob/main/build.rs

I'm not sure what to actually do with the man file from here, I guess it's up to the packaging process to do something with it? See https://github.com/shssoichiro/oxipng/issues/69#issuecomment-1963352536

Note I couldn't see a way to include the DISPLAY chunk names from the constant as we did before. They're now just hardcoded into the help and will require manually updating if the list changes.

Closes #526

andrews05 commented 8 months ago

Maybe we can use cargo-deb to make a deb package in the github workflow.

musicinmybrain commented 8 months ago

I'm not sure what to actually do with the man file from here, I guess it's up to the packaging process to do something with it? See #69 (comment)

Speaking as the current maintainer of the Fedora and EPEL packages, if the build process generates a man page then that’s all I need. I can easily install it.

andrews05 commented 8 months ago

@musicinmybrain Excellent, that's what I was hoping.

AlexTMjugador commented 8 months ago

This is beautiful, great work! For reference, here's an excerpt of the rendered page:

Rendered man page

It was faster for me to push two extra small changes than explaining them on a PR review, but the summary of what I did is as follows:

andrews05 commented 8 months ago

Awesome, thanks @AlexTMjugador, your changes look great!

What do you think about changing the workflow to use cargo-deb for the linux builds?

AlexTMjugador commented 8 months ago

What do you think about changing the workflow to use cargo-deb for the linux builds?

I think that's a good and doable idea. We can begin distributing the generated .deb ourselves too, so even if we don't make it to the official Debian repositories anytime soon, people can still manage their OxiPNG install with the APT package manager.