diff --git a/bin/cppman b/bin/cppman index ba2ef86..bb059a8 100755 --- a/bin/cppman +++ b/bin/cppman @@ -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, diff --git a/cppman/config.py b/cppman/config.py index fa88a85..0ed0782 100644 --- a/cppman/config.py +++ b/cppman/config.py @@ -27,7 +27,7 @@ class Config(object): - PAGERS = ['vim', 'nvim', 'less', 'system'] + PAGERS = ['vim', 'nvim', 'less', 'system', 'mansystem'] SOURCES = ['cplusplus.com', 'cppreference.com'] DEFAULTS = { diff --git a/cppman/lib/pager.sh b/cppman/lib/pager.sh index 439be07..12d969f 100755 --- a/cppman/lib/pager.sh +++ b/cppman/lib/pager.sh @@ -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<&- | { diff --git a/misc/completions/fish/cppman.fish b/misc/completions/fish/cppman.fish index 5982a20..2378e22 100644 --- a/misc/completions/fish/cppman.fish +++ b/misc/completions/fish/cppman.fish @@ -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" diff --git a/misc/completions/zsh/_cppman b/misc/completions/zsh/_cppman index 720c703..1b43009 100644 --- a/misc/completions/zsh/_cppman +++ b/misc/completions/zsh/_cppman @@ -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:" \