fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Johannes AltmanningerMark private functions that don't need localizationa53db7256

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