lib/Tools/doc
author paulson
Thu, 05 Jun 1997 13:22:25 +0200
changeset 3403 6cc663f6d62e
parent 3173 0013af1bc2c4
child 8130 b077b79061b6
permissions -rwxr-xr-x
A slight simplification of optstring The new "simpset" keyword in the "recdef" declaration

#!/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