aboutsummaryrefslogtreecommitdiffstats
path: root/bin/xman
blob: 5f4efed09a738946a04bd7cd7bc32641ed506c8b (plain) (blame)
1
2
3
4
5
6
7
8
9
#!/bin/sh
# xmandoc MANPAGE - read manpage of possibly not installed package

xlocate "man/man..\?/$1\.[0-9]" 2>/dev/null |
        { grep . || { echo "xmandoc: No entry for $1 found." 1>&2; exit 1; } } |
        while read -r pkg page; do
                page=${page#* -> }
                xbps-query --cat=$page ${pkg%-*} | mandoc -O width=205 -a
        done