lib/Tools/doc
author oheimb
Thu, 15 Feb 2001 16:01:07 +0100
changeset 11139 b092ad5cd510
parent 10555 2323ec838401
child 14981 e73f8140af78
permissions -rwxr-xr-x
moved wellorder_LeastI,wellorder_Least_le,wellorder_not_less_Least from Nat.ML to Wellfounded_Recursion.ML moved Least_equality from Nat.ML to Ord.thy moved wf_less from Nat.ML to NatDef.ML added wellorder axclass nonempty_has_least of Nat.ML -> ex_has_least_nat of Wellfounded_Relations.ML added min_of_mono, max_of_mono, max_leastL, max_leastR to Ord.thy

#!/usr/bin/env bash
#
# $Id$
# Author: Markus Wenzel, TU Muenchen
# License: GPL (GNU GENERAL PUBLIC LICENSE)
#
# 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

if [ -z "$DOC" ]; then
  ORIG_IFS="$IFS"
  IFS=":"
  for DIR in $ISABELLE_DOCS
  do
    [ -f "$DIR/Contents" ] && grep -v "^>>" "$DIR/Contents"
  done
  IFS="$ORIG_IFS"
else
  ORIG_IFS="$IFS"
  IFS=":"
  for DIR in $ISABELLE_DOCS
  do
    [ -f "$DIR/$DOC.dvi" ] && { cd "$DIR"; IFS="$ORIG_IFS"; exec $DVI_VIEWER "$DOC.dvi"; }
  done
  IFS="$ORIG_IFS"
  fail "Unknown Isabelle document: $DOC"  
fi