lib/Tools/logo
author kleing
Mon Jun 21 10:25:57 2004 +0200 (2004-06-21)
changeset 14981 e73f8140af78
parent 10555 2323ec838401
child 15574 b1d1b5bfc464
permissions -rwxr-xr-x
Merged in license change from Isabelle2004
     1 #!/usr/bin/env bash
     2 #
     3 # $Id$
     4 # Author: Markus Wenzel, TU Muenchen
     5 #
     6 # DESCRIPTION: create an instance of the Isabelle logo
     7 
     8 
     9 PRG="$(basename "$0")"
    10 
    11 function usage()
    12 {
    13   echo
    14   echo "Usage: $PRG [OPTIONS] NAME"
    15   echo
    16   echo "  Create instance NAME of the Isabelle logo (as EPS)."
    17   echo
    18   echo "  Options are:"
    19   echo "    -o OUTFILE   set output file (default determined from NAME)"
    20   echo "    -q           quiet mode"
    21   echo
    22   exit 1
    23 }
    24 
    25 function fail()
    26 {
    27   echo "$1" >&2
    28   exit 2
    29 }
    30 
    31 
    32 ## process command line
    33 
    34 # options
    35 
    36 OUTFILE=""
    37 QUIET=""
    38 
    39 while getopts "o:q" OPT
    40 do
    41   case "$OPT" in
    42     o)
    43       OUTFILE="$OPTARG"
    44       ;;
    45     q)
    46       QUIET=true
    47       ;;
    48     \?)
    49       usage
    50       ;;
    51   esac
    52 done
    53 
    54 shift $(($OPTIND - 1))
    55 
    56 
    57 # args
    58 
    59 NAME="-"
    60 [ "$#" -ge 1 ] && { NAME="$1"; shift; }
    61 
    62 [ "$#" -ne 0 -o "$NAME" = "-" ] && usage
    63 
    64 
    65 ## main
    66 
    67 if [ -z "$OUTFILE" ]; then
    68   OUTFILE=$(echo "$NAME" | tr A-Z a-z)
    69   [ -n "$OUTFILE" ] && OUTFILE="_$OUTFILE"
    70   OUTFILE="isabelle${OUTFILE}.eps"
    71 fi
    72 
    73 #set by configure
    74 AUTO_PERL=perl
    75 
    76 if [ "$OUTFILE" = "-" ]; then
    77   "$AUTO_PERL" -p -e "s/<any>/$NAME/" "$ISABELLE_HOME/lib/logo/isabelle_any.eps"
    78 else
    79   [ -z "$QUIET" ] && echo "$OUTFILE" >&2
    80   "$AUTO_PERL" -p -e "s/<any>/$NAME/" "$ISABELLE_HOME/lib/logo/isabelle_any.eps" > "$OUTFILE"
    81 fi