2021-07-02 16:33:30 +00:00
|
|
|
#!/bin/sh
|
2021-07-29 14:02:20 +00:00
|
|
|
# open info-page, man-page or buffered help flag
|
2021-09-16 12:18:26 +00:00
|
|
|
set -o pipefail
|
|
|
|
paginate="${PAGER:-less} +Gg"
|
2021-07-02 16:33:30 +00:00
|
|
|
case $1 in
|
2021-07-06 22:48:35 +00:00
|
|
|
(zsh|zmv) # https://unix.stackexchange.com/questions/19290/zmv-for-zsh-dry-runs-and-man-pages
|
2021-09-16 12:18:26 +00:00
|
|
|
search="${@:$#}"
|
|
|
|
# need to install zsh-doc package for info pages
|
|
|
|
info --vi-keys $(test $search != zsh && echo --index-search=$search) zsh || LESS="$LESS +/^ *${@:$#} *\\[" man zshall;;
|
|
|
|
(vlc) unbuffer vlc --full-help "${@:2}" | $paginate;;
|
|
|
|
(gh|chordpro) $@ --help | $paginate;;
|
|
|
|
(*) info "$1" -w | grep -v "manpages" && pinfo "$@" || man "$@" || ( "$@" --help || "$@" -help ) 2>&1 | $paginate;;
|
2021-07-02 16:33:30 +00:00
|
|
|
esac
|