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
|
# Copyright (c) P.J.Gawthrop, 1998
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.4 1999/10/19 00:34:10 peterg
## *** empty log message ***
##
## Revision 1.3 1999/08/18 06:17:55 peterg
## Modular form
##
## Revision 1.2 1999/03/09 00:03:55 peterg
## Major revisions for release 3.5
##
## Revision 1.1 1998/10/20 08:15:17 peterg
## Initial revision
##
###############################################################
#Look for a command line argument
while [ -n "`echo $1 | grep '^-'`" ]; do
case $1 in
--help ) echo xmtt
echo xmtt -update
exit;;
-update ) echo Creating representation list for mtt;
mtt2reps_txt> $MTTPATH/REPS;
echo Creating examples list for mtt;
mtt -q help examples> $MTTPATH/EXAMPLES;;
-example ) examples='examples';;
*)
echo "$1 is an invalid argument - ignoring" ;;
esac
shift
done
if [ -n "$examples" ]; then
mtt -q copy $1;
cd $1;
xmtt
exit
fi
## Create the menu
mtt_make_menu > .xmtt_menu
## Use tk shell (wish)
name=`basename $PWD`
wish .xmtt_menu -name $name
|
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
|
>
|
|
|
|
>
|
>
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
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
90
91
92
93
94
|
# Copyright (c) P.J.Gawthrop, 1998
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.5 2000/09/14 07:50:08 peterg
## *** empty log message ***
##
## Revision 1.4 1999/10/19 00:34:10 peterg
## *** empty log message ***
##
## Revision 1.3 1999/08/18 06:17:55 peterg
## Modular form
##
## Revision 1.2 1999/03/09 00:03:55 peterg
## Major revisions for release 3.5
##
## Revision 1.1 1998/10/20 08:15:17 peterg
## Initial revision
##
###############################################################
#Basic paths
dotfile="$HOME/.mtt"
xdotfile="${dotfile}/xmtt"
repfile="${xdotfile}/reps"
exfile="${xdotfile}/examples"
menufile=".xmtt_menu"
#Look for a command line argument
while [ -n "`echo $1 | grep '^-'`" ]; do
case $1 in
--help|-h ) echo "usage:"
echo " xmtt"
echo " xmtt --update"
echo " xmtt --example example_name"
echo " xmtt --help"
exit;;
--update|-u ) echo Creating representation list for mtt;
mtt2reps_txt> ${repfile};
echo Creating examples list for mtt;
mtt -q help examples> ${exfile};
exit;;
--example|-e ) shift; example=$1;;
*)
echo "$1 is an invalid argument - ignoring" ;;
esac
shift
done
if [ -n "${example}" ]; then
mtt -q copy ${example};
cd ${example};
xmtt
exit
fi
## Make sure files exist
if [ -e "${xdotfile}" ]; then
echo ${xdotfile} exists >/dev/null
else
echo Creating ${xdotfile}
mkdir --parents ${xdotfile}
fi
if [ -e "${repfile}" ]; then
echo ${repfile} exists >/dev/null
else
echo Creating ${repfile} and ${exfile}
xmtt --update
echo done.
fi
## Create the menu
mtt_make_menu > ${menufile}
## Use tk shell (wish)
name=`basename $PWD`
wish ${menufile} -name $name
|