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

Adding a Manpage #45

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Conversation

Rushmore75
Copy link

In #44 a manpage was added, this PR now installed the manpage to relative to the location that the program was installed in.
Ex:
program: ~/.cargo/bin/shotgun
manpage: ~/.cargo/man/man1/shotugn.1

This path isn't, by default, on the manpath thus it would require more configuration from the user's end. It could also be installed onto one of the existing manpath(s) but this would break convention. LMK your thoughts.

Added manpage using groff markdown using the man macro.
Using `groff -Tascii -man shotgun.man` to transpile.
This page can be viewed using the `man` command, thus giving you the
program's manual.
There's most likely a better place/way to do this, but it's a start.
@pickfire
Copy link
Collaborator

pickfire commented Sep 1, 2023

I never seen this from other rust repositories, where did you take this idea from?

@Rushmore75
Copy link
Author

This is just something I made up. It appears that cargo doesn't have a default home for man pages, but based on /etc/man_db.conf it seems that they would go in a adjacent directory under man/:

MANPATH_MAP	/usr/local/bin		/usr/local/man

therefore:

~/.cargo/bin    ~/.cargo/man

would seem to be logical, however, it isn't a default or standard by any means tho. The end user would have to add ~/.cargo/man to their $MANPATH. (see manpath(1))

@Rushmore75 Rushmore75 changed the title Automatically installing the manpage Adding a Manpage Sep 2, 2023
@Rushmore75 Rushmore75 marked this pull request as draft September 2, 2023 04:56
@9ary
Copy link
Member

9ary commented Sep 2, 2023

As far as I know, cargo doesn't really support building/installing any resources alongside the executable.

This means that ~/.cargo/man isn't a very good idea (especially if no one else is creating subdirs there). I think I would rather leave this up to packagers.

To be completely honest, I don't even recommend installing shotgun using cargo anyway, the preferred method is to package it for your distro.

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

Successfully merging this pull request may close these issues.

3 participants