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

Cannot use cppreference as cppman source, but cplusplus.com works ok #156

Open
nemeshnorbert opened this issue May 13, 2023 · 3 comments
Open

Comments

@nemeshnorbert
Copy link

nemeshnorbert commented May 13, 2023

Here is a list of commands to demonstrate the issue

norbert@norberrt ~  0 ✓ (5.291s) 14:11:27 
$ sudo apt-get purge --autoremove cppman
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  cppman*
0 upgraded, 0 newly installed, 1 to remove and 4 not upgraded.
After this operation, 1,021 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 213874 files and directories currently installed.)
Removing cppman (0.5.0+dfsg1-1) ...
Processing triggers for man-db (2.9.1-1) ...
norbert@norberrt ~  0 ✓ (6.271s) 14:11:39 
$ sudo apt-get install cppman
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  cppman
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
Need to get 0 B/159 kB of archives.
After this operation, 1,021 kB of additional disk space will be used.
Selecting previously unselected package cppman.
(Reading database ... 213850 files and directories currently installed.)
Preparing to unpack .../cppman_0.5.0+dfsg1-1_all.deb ...
Unpacking cppman (0.5.0+dfsg1-1) ...
Setting up cppman (0.5.0+dfsg1-1) ...
Processing triggers for man-db (2.9.1-1) ...
norbert@norberrt ~  0 ✓ (3.580s) 14:11:45 
$ cppman --help
Usage: cppman [OPTION...] PAGE...

Options:
  -s SOURCE, --source=SOURCE
                        Select source, either 'cppreference.com' or
                        'cplusplus.com'. Default is 'cplusplus.com'.
  -c, --cache-all       Cache all available man pages from cppreference.com
                        and cplusplus.com to enable offline browsing.
  -C, --clear-cache     Clear all cached files.
  -f KEYWORD, --find-page=KEYWORD
                        Find man page.
  -o, --force-update    Force cppman to update existing cache when '--cache-
                        all' or browsing man pages that were already cached.
  -m MANDB, --use-mandb=MANDB
                        Accepts 'true' or 'false'. If true, cppman adds
                        manpage path to mandb so that you can view C++
                        manpages with `man' command. The default value is
                        'false'.
  -p PAGER, --pager=PAGER
                        Select pager to use, accepts 'vim', 'less' or
                        'system'. 'system' uses $PAGER environment as pager.
                        The default value is 'vim'.
  -r, --rebuild-index   rebuild index database for the selected source, either
                        'cppreference.com' or 'cplusplus.com'.
  -v, --version         Show version information.
  --force-columns=FORCE_COLUMNS
                        Force terminal columns.
  -h, --help            show this help message and exit
norbert@norberrt ~  0 ✓ (132ms) 14:12:02 
$ cppman -s cplusplus.com
Source set to `cplusplus.com'.
norbert@norberrt ~  0 ✓ (144ms) 14:12:33 
$ cppman std::unordered_map
Vim: Reading from stdin...

norbert@norberrt ~  0 ✓ (2.384s) 14:12:41 
$ cppman -s cppreference.com
Source set to `cppreference.com'.
norbert@norberrt ~  0 ✓ (144ms) 14:12:49 
$ cppman std::unordered_map
error: HTTP Error 403: Forbidden
norbert@norberrt ~  0 ✓ (428ms) 14:12:54 
$ cppman --version
/usr/bin/cppman Ver 0.5.0
Copyright (C) 2010 Wei-Ning Huang
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Wei-Ning Huang (AZ) <[email protected]>.
norbert@norberrt ~  0 ✓ (102ms) 14:14:20 
$ dpkg -l | grep cppman
ii  cppman                                     0.5.0+dfsg1-1                       all          C++ 98/11 manual pages for Linux, with source from cplusplus.com
norbert@norberrt ~  0 ✓ (62.4ms) 14:14:33 
$ 

How to fix this problem?

I do not want to use cplusplus becuase it often gives irrelevant man pages. See example above for std::unordered_map.

@nemeshnorbert
Copy link
Author

nemeshnorbert commented May 13, 2023

Well, I figured this out. I use Ubuntu 20.04.6 LTS.

The problem is that deb package is outdated. If you install cppman via pip and use cppman like this
~/.local/bin/cppman std::unordered_map::begin everything works fine.

@czchen , please update deb packages!

@aitjcize
Copy link
Owner

@czchen do you mind helping with the update of the debian package? Thanks in advanced!

@czchen
Copy link
Contributor

czchen commented May 14, 2023

Debian is in full freeze for release now, will update package once Bookworm is released.

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

No branches or pull requests

3 participants