[GH-ISSUE #45] man page #21

Closed
opened 2026-06-08 11:25:19 +03:00 by zhus · 11 comments
Owner

Originally created by @ConorSheehan1 on GitHub (Dec 18, 2019).
Original GitHub issue: https://github.com/bootandy/dust/issues/45

Awesome work!

Any chance of adding a man page?
Maybe something like ripgrep has using asciidoc?
https://github.com/BurntSushi/ripgrep/blob/7cbc535d70a53c81dfa3e58552c01f21c2e38d28/build.rs#L66

❯ man dust
No manual entry for dust

I see dust --help works, but it'd be handy to have a man page too, since it's many peoples first instinct when trying a new cli tool.

Originally created by @ConorSheehan1 on GitHub (Dec 18, 2019). Original GitHub issue: https://github.com/bootandy/dust/issues/45 Awesome work! Any chance of adding a man page? Maybe something like ripgrep has using asciidoc? https://github.com/BurntSushi/ripgrep/blob/7cbc535d70a53c81dfa3e58552c01f21c2e38d28/build.rs#L66 ``` ❯ man dust No manual entry for dust ``` I see `dust --help` works, but it'd be handy to have a man page too, since it's many peoples first instinct when trying a new cli tool.
zhus closed this issue 2026-06-08 11:25:19 +03:00
Author
Owner

@bootandy commented on GitHub (Dec 19, 2019):

sounds good, if you want to open a PR I'll review it, otherwise I'll do it myself over the holidays.

<!-- gh-comment-id:567412011 --> @bootandy commented on GitHub (Dec 19, 2019): sounds good, if you want to open a PR I'll review it, otherwise I'll do it myself over the holidays.
Author
Owner

@ConorSheehan1 commented on GitHub (Dec 19, 2019):

I'd like to help but I don't know much about rust or asciidoc. I'll give it a try over the holidays if you haven't gotten to it already.

<!-- gh-comment-id:567603588 --> @ConorSheehan1 commented on GitHub (Dec 19, 2019): I'd like to help but I don't know much about rust or asciidoc. I'll give it a try over the holidays if you haven't gotten to it already.
Author
Owner

@bootandy commented on GitHub (Jan 15, 2020):

Can't figure this out

It seems this is done by creating a task in 'build.rs' at the top level which is run when cargo install is run. There you can generate a man page (in asciidoc) using a tool like this one: https://crates.io/crates/man/0.1.0

But the only way I can see of getting the man page into the system is to then copy it to /usr/share/man/man1/ as part of the build step and that seems a bit intrusive. I looked at bat and fd and neither of those libraries seem to create man pages in build.rs and so I'm inclined to not do this.

Happy to include this if someone figures out a nice way to do it.

<!-- gh-comment-id:574401925 --> @bootandy commented on GitHub (Jan 15, 2020): Can't figure this out It seems this is done by creating a task in 'build.rs' at the top level which is run when cargo install is run. There you can generate a man page (in asciidoc) using a tool like this one: https://crates.io/crates/man/0.1.0 But the only way I can see of getting the man page into the system is to then copy it to `/usr/share/man/man1/` as part of the build step and that seems a bit intrusive. I looked at bat and fd and neither of those libraries seem to create man pages in build.rs and so I'm inclined to not do this. Happy to include this if someone figures out a nice way to do it.
Author
Owner

@ConorSheehan1 commented on GitHub (Jan 15, 2020):

No worries man, sorry I didn't get around to it! I underestimated the stuff I thought I'd get done over the holidays. If I get a chance I'll show it to some friends who know rust and see if we can crack it

<!-- gh-comment-id:574404715 --> @ConorSheehan1 commented on GitHub (Jan 15, 2020): No worries man, sorry I didn't get around to it! I underestimated the stuff I thought I'd get done over the holidays. If I get a chance I'll show it to some friends who know rust and see if we can crack it
Author
Owner

@bootandy commented on GitHub (Jan 15, 2020):

Should look at this again when this issue is resolved:
https://github.com/rust-lang/cargo/issues/2729

<!-- gh-comment-id:574606776 --> @bootandy commented on GitHub (Jan 15, 2020): Should look at this again when this issue is resolved: https://github.com/rust-lang/cargo/issues/2729
Author
Owner

@acheam0 commented on GitHub (Jan 18, 2021):

I think a manpage would be a great addition to the software. Until the issue mentioned above is resolved, perhaps this could be done similarly to how Alacritty does it? The manpage and other extras aren't installed by cargo, but they are included in the source code, and can be easily installed manually to /usr/local/share/man/man1 for those who want them.

<!-- gh-comment-id:761889444 --> @acheam0 commented on GitHub (Jan 18, 2021): I think a manpage would be a great addition to the software. Until the issue mentioned above is resolved, perhaps this could be done similarly to how Alacritty does it? The manpage and other extras aren't installed by cargo, but they are included in the source code, and can be easily installed manually to `/usr/local/share/man/man1` for those who want them.
Author
Owner

@andy5995 commented on GitHub (Jan 18, 2021):

Can't figure this out

It seems this is done by creating a task in 'build.rs' at the top level which is run when cargo install is run. There you can generate a man page (in asciidoc) using a tool like this one: https://crates.io/crates/man/0.1.0
Happy to include this if someone figures out a nice way to do it.

Note the comments here about using build.rs

https://users.rust-lang.org/t/installing-data-files-assets-when-cargo-install-is-run/47690/2

For one of my projects, we decided to use a configure.ac and Makefile.in to handle the installation and uninstallation of the extra stuff that often accompanies a package:

https://github.com/TelluricDeckay/telluricdeckay/tree/feat/implement-ice

I did that based on this HowTo

<!-- gh-comment-id:761890681 --> @andy5995 commented on GitHub (Jan 18, 2021): > Can't figure this out > > It seems this is done by creating a task in 'build.rs' at the top level which is run when cargo install is run. There you can generate a man page (in asciidoc) using a tool like this one: https://crates.io/crates/man/0.1.0 > Happy to include this if someone figures out a nice way to do it. Note the comments here about using build.rs https://users.rust-lang.org/t/installing-data-files-assets-when-cargo-install-is-run/47690/2 For one of my projects, we decided to use a configure.ac and Makefile.in to handle the installation and uninstallation of the extra stuff that often accompanies a package: https://github.com/TelluricDeckay/telluricdeckay/tree/feat/implement-ice I did that based on this [HowTo](https://aravindavk.in/blog/autoconf-for-rust-projects/)
Author
Owner

@crypticC0der commented on GitHub (Feb 20, 2021):

the man page would be great if anyone can work it out, this and the fewer options compared to du are the only thinks keeping me from using it

<!-- gh-comment-id:782705494 --> @crypticC0der commented on GitHub (Feb 20, 2021): the man page would be great if anyone can work it out, this and the fewer options compared to du are the only thinks keeping me from using it
Author
Owner

@cherryblossom000 commented on GitHub (Jul 14, 2021):

Homebrew's ripgrep formula installs the man page from the build dir using man1.install:

# Completion scripts and manpage are generated in the crate's build
# directory, which includes a fingerprint hash. Try to locate it first
out_dir = Dir["target/release/build/ripgrep-*/out"].first
man1.install "#{out_dir}/rg.1"
<!-- gh-comment-id:879441370 --> @cherryblossom000 commented on GitHub (Jul 14, 2021): [Homebrew's ripgrep formula](https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/ripgrep.rb#L30-L33) installs the man page from the build dir using [`man1.install`](https://docs.brew.sh/Formula-Cookbook#variables-for-directory-locations): ```rb # Completion scripts and manpage are generated in the crate's build # directory, which includes a fingerprint hash. Try to locate it first out_dir = Dir["target/release/build/ripgrep-*/out"].first man1.install "#{out_dir}/rg.1" ```
Author
Owner

@bootandy commented on GitHub (Jul 19, 2021):

New clap crate implies it will give us this for free!
https://rust-cli.github.io/book/in-depth/docs.html

<!-- gh-comment-id:882541251 --> @bootandy commented on GitHub (Jul 19, 2021): New clap crate implies it will give us this for free! https://rust-cli.github.io/book/in-depth/docs.html
Author
Owner

@alexanderkjall commented on GitHub (Jan 27, 2023):

I use man in my project to generate a man page from build.rs : https://github.com/cortex/ripasso/blob/master/cursive/build.rs#L3

I have also seen https://crates.io/crates/clap_mangen being used, I need a man page in order to package this for Debian, I could also send it in as a PR if you have any opinion on which method you prefer?

<!-- gh-comment-id:1406784802 --> @alexanderkjall commented on GitHub (Jan 27, 2023): I use man in my project to generate a man page from build.rs : https://github.com/cortex/ripasso/blob/master/cursive/build.rs#L3 I have also seen https://crates.io/crates/clap_mangen being used, I need a man page in order to package this for Debian, I could also send it in as a PR if you have any opinion on which method you prefer?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#21