equal
deleted
inserted
replaced
12 { |
12 { |
13 echo |
13 echo |
14 echo "Usage: $PRG [OPTIONS] [GRAPHFILE]" |
14 echo "Usage: $PRG [OPTIONS] [GRAPHFILE]" |
15 echo |
15 echo |
16 echo " Options are:" |
16 echo " Options are:" |
17 echo " -d delete file after use" |
17 echo " -c cleanup -- remove GRAPHFILE after use" |
18 echo " -o FILE output to FILE (ps, eps, pdf)" |
18 echo " -o FILE output to FILE (ps, eps, pdf)" |
19 echo |
19 echo |
20 exit 1 |
20 exit 1 |
21 } |
21 } |
22 |
22 |
29 |
29 |
30 ## process command line |
30 ## process command line |
31 |
31 |
32 # options |
32 # options |
33 |
33 |
34 DELETE="" |
34 CLEAN="" |
35 OUTFILE="" |
35 OUTFILE="" |
36 |
36 |
37 while getopts "do:" OPT |
37 while getopts "co:" OPT |
38 do |
38 do |
39 case "$OPT" in |
39 case "$OPT" in |
40 d) |
40 c) |
41 DELETE=true |
41 CLEAN=true |
42 ;; |
42 ;; |
43 o) |
43 o) |
44 OUTFILE="$OPTARG" |
44 OUTFILE="$OPTARG" |
45 ;; |
45 ;; |
46 \?) |
46 \?) |
64 export CLASSPATH="$ISABELLE_HOME/lib/browser/GraphBrowser.jar" |
64 export CLASSPATH="$ISABELLE_HOME/lib/browser/GraphBrowser.jar" |
65 if [ -z "$GRAPHFILE" ]; then |
65 if [ -z "$GRAPHFILE" ]; then |
66 cd "$ISABELLE_BROWSER_INFO" |
66 cd "$ISABELLE_BROWSER_INFO" |
67 exec java GraphBrowser.GraphBrowser |
67 exec java GraphBrowser.GraphBrowser |
68 else |
68 else |
|
69 PRIVATE_FILE="${ISABELLE_TMP:-/tmp}/$$"$(basename "$GRAPHFILE") |
|
70 if [ -n "$CLEAN" ]; then |
|
71 mv -f "$GRAPHFILE" "$PRIVATE_FILE" || fail "Cannot move file: $FILE" |
|
72 else |
|
73 cp -f "$GRAPHFILE" "$PRIVATE_FILE" || fail "Cannot copy file: $FILE" |
|
74 fi |
|
75 |
69 PDF="" |
76 PDF="" |
70 case "$OUTFILE" in |
77 case "$OUTFILE" in |
71 *.pdf) |
78 *.pdf) |
72 OUTFILE="${OUTFILE%%.pdf}.eps" |
79 OUTFILE="${OUTFILE%%.pdf}.eps" |
73 PDF=true |
80 PDF=true |
74 ;; |
81 ;; |
75 esac |
82 esac |
76 |
83 |
77 if [ -z "$OUTFILE" ]; then |
84 if [ -z "$OUTFILE" ]; then |
78 java GraphBrowser.GraphBrowser "$GRAPHFILE" |
85 java GraphBrowser.GraphBrowser "$PRIVATE_FILE" |
79 else |
86 else |
80 java GraphBrowser.Console "$GRAPHFILE" "$OUTFILE" |
87 java GraphBrowser.Console "$PRIVATE_FILE" "$OUTFILE" |
81 fi |
88 fi |
82 RC="$?" |
89 RC="$?" |
83 |
90 |
84 if [ -n "$PDF" ]; then |
91 if [ -n "$PDF" ]; then |
85 "$ISABELLE_EPSTOPDF" "$OUTFILE" || fail "Failed to produce pdf output" |
92 "$ISABELLE_EPSTOPDF" "$OUTFILE" || fail "Failed to produce pdf output" |
86 fi |
93 fi |
87 |
94 |
88 [ -n "$DELETE" ] && rm -f "$GRAPHFILE" |
95 rm -f "$PRIVATE_FILE" |
89 fi |
96 fi |
90 |
97 |
91 exit "$RC" |
98 exit "$RC" |