Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bin/cppman
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ def main():
"with `man' command. The default value is 'false'."),
make_option('-p', '--pager', action='store', dest='pager',
help="Select pager to use, accepts 'vim', 'nvim', 'less'"
"or 'system'. 'system' uses $PAGER environment as pager. "
"'system' or 'mansystem'. 'system' uses $PAGER environment as pager. "
"'mansystem' uses $MANPAGER environment as pager. "
"The default value is 'vim'."),
make_option('-r', '--rebuild-index', action='store_true',
dest='rebuild_index', default=False,
Expand Down
2 changes: 1 addition & 1 deletion cppman/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@


class Config(object):
PAGERS = ['vim', 'nvim', 'less', 'system']
PAGERS = ['vim', 'nvim', 'less', 'system', 'mansystem']
SOURCES = ['cplusplus.com', 'cppreference.com']

DEFAULTS = {
Expand Down
4 changes: 4 additions & 0 deletions cppman/lib/pager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ case $pager_type in
[ -z "$PAGER" ] && PAGER=less
render | $PAGER
;;
mansystem)
[ -z "$MANPAGER" ] && PAGER=less
render | $MANPAGER
;;

vim|nvim)
render | remove_escape 3<&- | {
Expand Down
2 changes: 1 addition & 1 deletion misc/completions/fish/cppman.fish
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ complete -c $progname -s C -l clear-cache -d "Clear all cached files"
complete -c $progname -s f -l find-page -d "Find man page"
complete -c $progname -s o -l force-update -d "Force cppman to update existing cache when '--cache-all' or browsing man pages that were already cached"
complete -c $progname -s m -l use-mandb -a "true false" -d "If true, cppman adds manpage path to mandb so that you can view C++ manpages with 'man' command"
complete -c $progname -s p -l pager -a "vim nvim less system" -d "Select pager to use"
complete -c $progname -s p -l pager -a "vim nvim less system mansystem" -d "Select pager to use"
complete -c $progname -s r -l rebuild-index -d "rebuild index database for the selected source"
complete -c $progname -s v -l version -d "Show version information"
complete -c $progname -l force-columns -d "Force terminal columns"
Expand Down
2 changes: 1 addition & 1 deletion misc/completions/zsh/_cppman
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ _arguments -n \
"(1 -)"{-h,--help}"[show help message and exit]" \
"(1 -)"{-o,--force-update}"[Force cppman to update existing cache when '--cache-all' or browsing man pages that were already cached.]" \
"(1 -)"{-m,--use-mandb=}"[If true, cppman adds manpage path to mandb so that you can view C++ manpages with 'man' command.]:MANDB:(true false)" \
"(1 -)"{-p,--pager=}"[Select pager to use.]:PAGER:(vim nvim less system)" \
"(1 -)"{-p,--pager=}"[Select pager to use.]:PAGER:(vim nvim less system mansystem)" \
"(1 -)"{-r,--rebuild-index}"[rebuild index database for the selected source.]" \
"(1 -)"{-v,--version}"[Show version information.]" \
"--force-columns=[Force terminal columns]:FORCE_COLUMNS:" \
Expand Down