aboutsummaryrefslogtreecommitdiff
path: root/bin/proofgeneral
blob: 0f900dc21f8e7fee6656de16850f8e713fae1d56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/sh
#
# Simple shell script for launching Proof General.
#
# Uses XEmacs in preference to Emacs
#
# PGHOME must be set to the directory where the lisp files of
# Proof General are installed.
#
# $Id$
#

# The relative path works for uninstalled package
PGHOME=..

# Try to find an Emacs executable 
if [ -z "$EMACS" ] || [ ! -x "$EMACS" ]; then
    if which xemacs > /dev/null; then 
	EMACS=`which xemacs`
    else 
	EMACS=`which emacs`
    fi
fi

NAME=`basename $0`

HELP="Usage: proofgeneral [OPTION] [FILE]...
  Launch Emacs Proof General editing the proof script FILE.

  Options:
    --emacs	        startup Proof General with emacs (GNU Emacs)
    --xemacs            startup Proof General with xemacs (XEmacs)
    --emacsbin <EMACS>  startup Proof General with emacs binary <EMACS>
    -h, --help          show this help and exit
    -v, --version       output version information and exit

  Examples:
    $NAME Example.thy	Load Proof General editing Isar file Example.thy
    $NAME example.v	Load Proof General editing Coq file Example.v

  Report bugs to <da+pg-bugs@inf.ed.ac.uk>.
"

VERSIONBLURB='Written by David Aspinall and others (see http://proofgeneral.inf.ed.ac.uk/AUTHORS).

Copyright (C) 1998-2004 LFCS, University of Edinburgh, UK.
This is free software; see the source for copying conditions.'

   
while 
  case $1 in 
    -h) 
	echo "$HELP" >&2
	exit 1;;
    --help)
	echo "$HELP" >&2
	exit 1;;
    -v) 
	VERSION=`grep proof-general-version $PGHOME/generic/proof-site.el | sed -e 's/.*Version //g' | sed -e 's/\. .*//g'`
	echo "$NAME" "($VERSION)" >&2
	echo "$VERSIONBLURB" >&2
	exit 1;;
    --version) 
	VERSION=`grep proof-general-version $PGHOME/generic/proof-site.el | sed -e 's/.*Version //g' | sed -e 's/\. .*//g'`
	echo "$NAME" "($VERSION)" >&2
	echo "$VERSIONBLURB" >&2
	exit 1;;
    --emacs)
	EMACS=`which emacs`;;
    --xemacs)
	EMACS=`which xemacs`;;
    --emacsbin)
	EMACS=$2
	shift;;
    -*) 
	echo "$NAME: option $1 not recognized. Use $NAME --help for help." 1>&2
	exit 1;;
    *) break;;
  esac
do shift; done


if [ ! -x "$EMACS" ]; then
    echo "$NAME: cannot find an Emacs or XEmacs executable.  Set EMACS or your PATH." 1>&2
    exit 1
fi
    
	
exec $EMACS -l $PGHOME/generic/proof-site.el -f proof-splash-display-screen "$@"