aitjcize / cppman

C++ 98/11/14 manual pages for Linux/MacOS
GNU General Public License v3.0
1.27k stars 79 forks source link

Unable to use `man` to access cpp man pages #84

Closed bbugyi200 closed 5 years ago

bbugyi200 commented 5 years ago

I ran cppman -c and then cppman -m true but man and apropos still cannot find any cpp man pages. I have verified that the man pages are indeed in my filesystem (i.e. the cppman -c command worked).

aitjcize commented 5 years ago

Can you check the content of $HOME/.mapath?

bbugyi200 commented 5 years ago

Did you mean $HOME/.manpath? Here are the contents of that file:

MANDATORY_MANPATH   /home/bryan/.local/share/man
SGSSGene commented 5 years ago

Hello

(Edit: Only needed for arch linux) I couldn't find any documentation, which explains how to make man page use $HOME/.manpath . But you can set the MANPATH variable: export MANPATH="${HOME}/.local/share/man:" (You probably want to add this line to your .bashrc).

bbugyi200 commented 5 years ago

@SGSSGene Thanks for your help, but that doesn't resolve this issue for me.

SGSSGene commented 5 years ago

@SGSSGene Thanks for your help, but that doesn't resolve this issue for me.

Mhm weird, which linux distribution are you using?

bbugyi200 commented 5 years ago

@SGSSGene Gentoo

SGSSGene commented 5 years ago

(My above statement was wrong). If you use ubuntu16.04 or gentoo it should work exactly how it is documented. I am using arch linux and it seems like they have a "lite" version of man installed.

To be able to look something up with man you need to have viewed it first with cppman because man can only look stuff up that is already in the cache.

cppman -m true # activate cppman for man
man std::vector # will not work, not in the cache
cppman std::vector # will look it up and put it in the cache
man std::vector # should work now

Also notice that while cppman can do partial search like cppman vector you need to do full qualified lookup for man std::vector (man vector will not work).

Spyros-Papanastasiou-667 commented 5 years ago

Can you run mandb --create --user-db? MANPATH and MANDATORY_MANPATH were also necessary for me.

SGSSGene commented 5 years ago

Does this issue still exists?

bbugyi200 commented 5 years ago

I wound up giving up and finding a different solution. I am unable to retest at the moment.

kiprasmel commented 3 years ago

I too had this issue (cppman does not take into account the $MANPATH variable etc.).

So I created this alias in .bashrc / .zshrc:

man() {
    /usr/bin/env man $* 2>/dev/null || cppman $*
}

:+1:

LoxLu250 commented 1 year ago

Another possible fix (if it fixes the problem add export line to .bashrc to fix permanently):

ln -s {$HOME}/.cache/cppman/cppreference.com {$HOME}/.local/share/man
export MANPATH="${HOME}/.local/share/man:"
mandb

Quick dirty fix: export MANPATH="${HOME}/.cache/cppman:" Works but breaks cppman, "cppman -c", "cppman -r", "cppman std::cout" all return "error: file is not a database" Fixed by clearing cache cppman -C

shirleyquirk commented 1 year ago

for me (Arch Linux) i had to create the ~/.manpath file and rerun cppman -m true

a fix on this end could be to change update_mandb_path in util.py to create that file if it doesn't exist, instead of aborting.