fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
a53db7256
master
1# localization: skip(private) 2function __fish_anypager --description"Print a pager to use" 3set -l pager 4# We prefer $PAGER if we have it 5set -q PAGER 6and echo $PAGER | read -at pager 7 8# or even $MANPAGER if we're allowed to 9if test " $argv [ 1 ] " = --with-manpager 10set -q MANPAGER 11and echo $MANPAGER | read -at pager 12end 13 14# We use them if they *exist* 15if command -q$pager [ 1 ] 16printf %s\n $pager 17return 0 18end 19 20# Cheesy hardcoded list of pagers. 21for cmdin less lv most more 22if command -q$cmd 23echo --$cmd 24return 0 25end 26end 27 28# We have no pager. 29# We could fall back to "cat", 30# but in some cases that's probably not helpful. 31return 1 32end