doc: view Isabelle documentation;
authorwenzelm
Mon Dec 09 09:02:15 1996 +0100 (1996-12-09)
changeset 2332ae592411c199
parent 2331 d6a56ff0d94e
child 2333 f1159f38ba4f
doc: view Isabelle documentation;
lib/Tools/doc
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/lib/Tools/doc	Mon Dec 09 09:02:15 1996 +0100
     1.3 @@ -0,0 +1,51 @@
     1.4 +#!/bin/bash -norc
     1.5 +#
     1.6 +# $Id$
     1.7 +#
     1.8 +# DESCRIPTION: view Isabelle documentation
     1.9 +#
    1.10 +# TODO:
    1.11 +#  - other formats than dvi (??)
    1.12 +
    1.13 +
    1.14 +PRG=$(basename $0)
    1.15 +
    1.16 +function usage()
    1.17 +{
    1.18 +  echo
    1.19 +  echo "Usage: $PRG [DOC]"
    1.20 +  echo
    1.21 +  echo "  View Isabelle documentation DOC, or show list of available documents."
    1.22 +  echo
    1.23 +  exit 1
    1.24 +}
    1.25 +
    1.26 +function fail()
    1.27 +{
    1.28 +  echo "$1" >&2
    1.29 +  exit 2
    1.30 +}
    1.31 +
    1.32 +
    1.33 +## args
    1.34 +
    1.35 +DOC=""
    1.36 +[ $# -ge 1 ] && { DOC="$1"; shift }
    1.37 +
    1.38 +[ $# -ne 0 -o "$DOC" = "-?" ] && usage
    1.39 +
    1.40 +
    1.41 +## main
    1.42 +
    1.43 +if [ -z "$DOC" ]; then
    1.44 +  for DIR in $ISABELLE_DOCS
    1.45 +  do
    1.46 +    [ -f $DIR/Contents ] && cat $DIR/Contents
    1.47 +  done
    1.48 +else
    1.49 +  for DIR in $ISABELLE_DOCS
    1.50 +  do
    1.51 +    [ -f $DIR/$DOC.dvi ] && exec $DVI_VIEWER $DIR/$DOC.dvi
    1.52 +  done
    1.53 +  fail "Unknown Isabelle document: $DOC"  
    1.54 +fi