aitjcize / cppman

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

No entry for the keyword #95

Closed lidaobing closed 5 years ago

lidaobing commented 5 years ago
$ cppman --version
/usr/local/bin/cppman Ver 0.4.9
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) <aitjcize@gmail.com>.
$ cppman override
No manual entry for override
$ cppman final
No manual entry for final
SGSSGene commented 5 years ago

The problem is that there is no information about 'override' and 'final' on cplusplus.com You can switch the source to cppreference.com which has the wished information:

$ cppman -s cppreference.com
$ cppman override

Notice that "final" is problematic, because there are several entries that kind of match:

$ cppman -f final
std::is_final [C++14]
std::is_final [since C++17]
std::is_final
final specifier (since C++11) [since C++11]
final specifier (since C++11) [C++11]

If you just call cppman final it will select 'std::is_final'. To actually get the keyword you need to call:

cppman "final specifier"

I am not sure if this should be considered a bug. @aitjcize any thoughts on this?

lidaobing commented 5 years ago

@SGSSGene thx

aitjcize commented 5 years ago

I think this is work-as-intended. By default, it'll match for std::KEYWORD which is more common. We could probably display a menu selection to allow the user to choose from, that way it's easier than typing the full name of the page.

SGSSGene commented 5 years ago

I am not a big fan of to much interactive command line tools. Maybe we should just add some bash and zsh completion. That should do most of it, I guess.

But what is the difference between std::is_final [C++14] and std::is_final? cppman "std::is_final [C++14]" doesn't call anything. should these maybe be filtered out?

Also I saw some other weird things like cppman "std::vector:: std::vector::cbegin"

SGSSGene commented 5 years ago

I made a huge change to the master. cppman final will open now 'final specifier' and cppman is_final will open std::is_final. Also since I added bash and zsh completion I see this issue as resolved.