cppman
cppman copied to clipboard
Don't overwrite existing manpages with -m true
cppman -m true -c overwrites pages that already exist, like memcpy and malloc, without checking. It would be nice to keep those versions, especially since they have some info that the C++ manuals don't (e.g. thread safety).
Looks like this could go in https://github.com/aitjcize/cppman/blob/master/cppman/main.py#L184, I might take a stab at it
Can you try adjust your MANPATH ? If you put the default MANPATH before cppman man path, it should find the system builtin man pages first.
Would it be possible for cppman to write it in ~/.manpath when run with -m? Normally I leave $MANPATH unset and just use the defaults returned by manpath
Would it be possible for
cppmanto write it in~/.manpathwhen run with-m? Normally I leave$MANPATHunset and just use the defaults returned bymanpath
That is exactly what cppman does. Cppman does not overwrite any system manuals. It only adjust the ~/.manpath.
This sounds like the same issue as #91 . I am not sure where it comes from. I also can't reproduce it. If you have any hint how to reproduce it, I would be very thankful.
~/.manpath takes precedence over other man pages. For example manpath returns /home/joshua/.node/share/man:/home/joshua/.local/share/man:/usr/local/man:/usr/local/share/man:/usr/share/man on my machine. $MANPATH is unset and ~/.manpath contains MANDATORY_MANPATH /home/joshua/.local/share/man.
I would like ~/.manpath not to take precedence. Maybe run manpath and append ~/.local/share/man to the end of that.
I have finally been able to reproduce it. The program manpath does a lot of magic. I looked into the source code to understand precisely what is being done in which order, but now I am more confused than ever. (Also it reassures me that C++ is the simpler language to read ;-) ).
What I am certain about is, that the different results come from the $PATH variable, which is being processed in manpath.
On one of my systems $PATH is set to /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
On the other system it is set to /home/q/bin:/home/q/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
The important part is the extra /home/q/.local/bin on one system compared to the other one.
manpath checks all paths in $PATH extended by ".", "../man" and "../share/man", which leads to finding /home/q/.local/share/man much earlier and setting it at the beginning of the results.
While on the other system where /home/q/.local/bin is not present, it will be added much later in the process.
This also means manpath will find the cppman pages on your system independently of the entry in ~/.manpath.
I don't know how to deal with this issue.
To begin with, I suggest using 3cpp as prefix instead of 3 to distinguish cpp pages. This should help with overriding pages.
Now, whatever cppman -m true is supposed to do, it doesn't, because the output of manpath stays the same. So I set it manually in shellrc: export MANPATH="$(manpath -g):$HOME/.cache/cppman". I suggest adding this to readme.
I cant confirm the bug on an Arch derivate from executing :Man inside neovim. Instead I get the autogenerated template pages loading.