Skip to content

Commit 12ddcb9

Browse files
authored
support MANPAGER as pager (#195)
1 parent af6c20a commit 12ddcb9

5 files changed

Lines changed: 9 additions & 4 deletions

File tree

bin/cppman

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ def main():
8383
"with `man' command. The default value is 'false'."),
8484
make_option('-p', '--pager', action='store', dest='pager',
8585
help="Select pager to use, accepts 'vim', 'nvim', 'less'"
86-
"or 'system'. 'system' uses $PAGER environment as pager. "
86+
"'system' or 'mansystem'. 'system' uses $PAGER environment as pager. "
87+
"'mansystem' uses $MANPAGER environment as pager. "
8788
"The default value is 'vim'."),
8889
make_option('-r', '--rebuild-index', action='store_true',
8990
dest='rebuild_index', default=False,

cppman/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

2929
class Config(object):
30-
PAGERS = ['vim', 'nvim', 'less', 'system']
30+
PAGERS = ['vim', 'nvim', 'less', 'system', 'mansystem']
3131
SOURCES = ['cplusplus.com', 'cppreference.com']
3232

3333
DEFAULTS = {

cppman/lib/pager.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ case $pager_type in
8484
[ -z "$PAGER" ] && PAGER=less
8585
render | $PAGER
8686
;;
87+
mansystem)
88+
[ -z "$MANPAGER" ] && PAGER=less
89+
render | $MANPAGER
90+
;;
8791

8892
vim|nvim)
8993
render | remove_escape 3<&- | {

misc/completions/fish/cppman.fish

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ complete -c $progname -s C -l clear-cache -d "Clear all cached files"
88
complete -c $progname -s f -l find-page -d "Find man page"
99
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"
1010
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"
11-
complete -c $progname -s p -l pager -a "vim nvim less system" -d "Select pager to use"
11+
complete -c $progname -s p -l pager -a "vim nvim less system mansystem" -d "Select pager to use"
1212
complete -c $progname -s r -l rebuild-index -d "rebuild index database for the selected source"
1313
complete -c $progname -s v -l version -d "Show version information"
1414
complete -c $progname -l force-columns -d "Force terminal columns"

misc/completions/zsh/_cppman

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ _arguments -n \
2626
"(1 -)"{-h,--help}"[show help message and exit]" \
2727
"(1 -)"{-o,--force-update}"[Force cppman to update existing cache when '--cache-all' or browsing man pages that were already cached.]" \
2828
"(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)" \
29-
"(1 -)"{-p,--pager=}"[Select pager to use.]:PAGER:(vim nvim less system)" \
29+
"(1 -)"{-p,--pager=}"[Select pager to use.]:PAGER:(vim nvim less system mansystem)" \
3030
"(1 -)"{-r,--rebuild-index}"[rebuild index database for the selected source.]" \
3131
"(1 -)"{-v,--version}"[Show version information.]" \
3232
"--force-columns=[Force terminal columns]:FORCE_COLUMNS:" \

0 commit comments

Comments
 (0)