why/gwhy-2.26.patch
2010-10-11 13:39:21 -04:00

53 lines
1.2 KiB
Diff

--- why-2.23-old/bin/gwhy.sh 2010-01-04 21:08:50.401993553 -0500
+++ why-2.23/bin/gwhy.sh 2010-01-05 08:31:05.989807947 -0500
@@ -1,11 +1,17 @@
#!/bin/sh
-case $1 in
+if ! test $1; then
+file=`zenity --file-selection --title="Select the file you want to open with gwhy"`;
+else
+file=$1
+fi
+
+case $file in
*.java)
- b=`basename $1 .java`
- krakatoa $1 || exit 1
+ b=`basename $file .java`
+ krakatoa $file || exit 1
echo "krakatoa on $b.java done"
- d=`dirname $1`
+ d=`dirname $file`
echo "cd $d"
cd $d
jessie -locs $b.jloc -why-opt -split-user-conj $b.jc || exit 2
@@ -13,20 +19,23 @@
make -f $b.makefile gui
;;
*.c)
- b=`basename $1 .c`
- caduceus -why-opt -split-user-conj $1 || exit 1
+ b=`basename $file .c`
+ caduceus -why-opt -split-user-conj $b.c || exit 1
make -f $b.makefile gui
;;
*.jc)
- b=`basename $1 .jc`
+ b=`basename $file .jc`
jessie -why-opt -split-user-conj $b.jc || exit 1
make -f $b.makefile gui
;;
*.mlw|*.why)
- gwhy-bin -split-user-conj $1
+ gwhy-bin -split-user-conj $file
+ ;;
+ ?*)
+ echo "$file does not have file type extension recognized by gwhy"
;;
*)
- echo "don't know what to do with $1"
+ echo "gwhy needs the name of a file to inspect in order to run"
esac