Corrected a long-standing error in which ending text with a literal
[xcircuit.git] / lib / tcl / xcircuit.sh.in
blob11db1b0e61ff78b83bdb1446a2df3a3781f46fac
1 #!/bin/sh
3 # This script starts xcircuit under the Tcl interpreter,
4 # reading commands from a special .wishrc script which
5 # launches xcircuit and retains the Tcl interactive interpreter.
8 loclibdir=${XCIRCUIT_LIB_DIR:=XCLIBDIR}
9 export XCIRCUIT_LIB_DIR
10 XCIRCUIT_WISH=WISH_EXE
11 export XCIRCUIT_WISH
13 # Hacks for Cygwin
14 if [ ${TERM:=""} = "cygwin" ]; then
15 export PATH=$PATH:TCLLIBDIR
16 export DISPLAY=${DISPLAY:=":0"}
19 TKCON=true
20 DNULL=
21 for i in $@ ; do
22 case $i in
23 -noc*)
24 TKCON=;;
25 -now*)
26 DNULL=true
27 TKCON=;;
28 --help)
29 echo "Standard usage:"
30 echo " xcircuit [filename]"
31 echo "Online documentation:"
32 echo " http://opencircuitdesign.com/xcircuit"
33 exit 0
35 --version)
36 echo "XCircuit version PROG_VERSION revision PROG_REVISION"
37 exit 0
39 esac
40 done
42 if [ $TKCON ]; then
44 if [ ! -f ${loclibdir}/CONSOLE ]; then
45 loclibdir=${loclibdir}/tcl
48 exec ${loclibdir}/CONSOLE \
49 -eval "source ${loclibdir}/CONSOLE_SCRIPT" \
50 -slave "package require Tk; set argc $#; set argv [list $*]; \
51 source ${loclibdir}/WRAPPER_INIT"
52 else
55 # Run the stand-in for wish (xcircexec), which acts exactly like "wish"
56 # except that it replaces ~/.wishrc with xcircuit.tcl. This executable is
57 # *only* needed when running without the console; the console itself is
58 # capable of sourcing the startup script.
60 if [ $DNULL ]; then
61 exec ${loclibdir}/xcircdnull -- $@
62 else
63 exec ${loclibdir}/xcircexec -- $@