-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbrowse_manual
executable file
·54 lines (41 loc) · 961 Bytes
/
browse_manual
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
# $1 = implpath
# find browser and display manuals
IMPL_PATH=$1
testx()
{
type -path "$1"
}
if [ -z "$IMPL_PATH" ] ; then
echo "syntax: $0 IMPL_PATH"
exit 1
fi
[ -z "$BROWSER" ] && BROWSER=`testx netscape`
[ -z "$BROWSER" ] && BROWSER=`testx mozilla`
[ -z "$BROWSER" ] && BROWSER=`testx lynx`
if [ -z "$DISPLAY" ] ; then
if [ -z "`echo $BROWSER |grep lynx`" ] ; then
echo "DISPLAY not set, trying to fall back to lynx"
fi
fi
echo "using browser $BROWSER"
for loc in "$HOME/lib/uqlx/docs" "$IMPL_PATH/docs" /usr/local/lib/uqlx/docs /usr/lib/uqlx/docs
do
if [ -f "$loc/uqlx_toc.html" ] ; then
DOC="$loc/uqlx_toc.html"
break
elif [ -f "$loc/uqlx.html" ] ; then
DOC="$loc/uqlx.html"
break
fi
done
if [ -n "$BROWSER" ] ; then
if [ -n "$DOC" ] ; then
$BROWSER $DOC
exit
fi
else
echo "no HTML browser found, set BROWSER"
fi
echo "trying xdvi.."
xdvi $IMPL_PATH/docs/uqlx