why/gwhy-2.33.patch
2014-11-15 14:19:02 -07:00

51 lines
1.2 KiB
Diff

--- bin/gwhy.sh.orig 2013-04-20 00:34:04.000000000 -0600
+++ bin/gwhy.sh 2013-05-10 09:12:22.968553542 -0600
@@ -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 -gen-only $1 || exit 1
+ b=`basename $file .java`
+ krakatoa -gen-only $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,18 +19,22 @@
make -f $b.makefile gui
;;
*.c)
- frama-c -jessie -jessie-atp=gui -jessie-why-opt="-split-user-conj" $1 || exit 1
+ frama-c -jessie -jessie-atp=gui -jessie-why-opt="-split-user-conj" $file || exit 1
;;
*.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