lib/Tools/doc
author wenzelm
Fri, 13 Mar 1998 18:15:14 +0100
changeset 4744 4469d498cd48
parent 3173 0013af1bc2c4
child 8130 b077b79061b6
permissions -rwxr-xr-x
moved addsplits [expand_if] from HOL_basic_ss to HOL_ss;

#!/bin/bash
#
# $Id$
#
# DESCRIPTION: view Isabelle documentation


PRG=$(basename $0)

function usage()
{
  echo
  echo "Usage: $PRG [DOC]"
  echo
  echo "  View Isabelle documentation DOC, or show list of available documents."
  echo
  exit 1
}

function fail()
{
  echo "$1" >&2
  exit 2
}


## args

DOC=""
[ $# -ge 1 ] && { DOC="$1"; shift; }

[ $# -ne 0 -o "$DOC" = "-?" ] && usage


## main

DOCS=$(echo $ISABELLE_DOCS | tr : " ")

if [ -z "$DOC" ]; then
  for DIR in $DOCS
  do
    [ -f $DIR/Contents ] && cat $DIR/Contents
  done
else
  for DIR in $DOCS
  do
    [ -f $DIR/$DOC.dvi ] && { cd $DIR; exec $DVI_VIEWER $DOC.dvi; }
  done
  fail "Unknown Isabelle document: $DOC"  
fi