summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-06-03 16:28:08 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-06-03 16:28:08 +0200
commite66cdc9ef77931bf63626a693459a2da833fc2e2 (patch)
tree492b37ca1cc301206b58efa5cbcc9c43f96246a1 /bin
parent2c10fda125bd547108ea9067594409df2cbeb4aa (diff)
bin/pkg: pkg_doc: First test for perldoc, then doc/
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pkg10
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/pkg b/bin/pkg
index e449973..7df34d1 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -296,13 +296,15 @@ pkg_changelog () {
}
pkg_doc () {
- # FIXME this sucks
- if ([ -r $PDIR/*/doc/$1 ]) {
- less $PDIR/*/doc/$1
- } elif ([ -x $PDIR/*/bin/$1 ]) {
+ # FIXME this globbing sucks
+ if ([ -x $PDIR/*/bin/$1 ]) {
if (file $PDIR/*/bin/$1 | grep 'perl script text executable' &> /dev/null) {
perldoc $PDIR/*/bin/$1
}
+ } elif ([ -r $PDIR/*/doc/$1 ]) {
+ less $PDIR/*/doc/$1
+ } else {
+ echo "No documentation found"
}
}