]> granicus.if.org Git - graphviz/commitdiff
When lefty updated dotty, he assumes ksh and made dotty.sh basically
authorellson <devnull@localhost>
Tue, 18 Oct 2005 18:56:31 +0000 (18:56 +0000)
committerellson <devnull@localhost>
Tue, 18 Oct 2005 18:56:31 +0000 (18:56 +0000)
a ksh script, and no longer has a dotty.ksh. Moved dotty.sh to dotty.ksh,
and restored old vanilla dotty.sh.

cmd/dotty/dotty.ksh

index 7ad10ddf330d71da24585349eed61c8b8c849934..3bb2b1622876b108eba8ab8877771c13b6e3bd44 100755 (executable)
@@ -1,8 +1,8 @@
-#!/bin/ksh
 
-FILES=""
+set -A FILES
 MLEVEL="0"
 LMODE="async"
+FLAGS=
 
 function usage {
     print "usage: dotty [-V] [-lm (sync|async)] [-el (0|1)] <filename>"
@@ -10,47 +10,53 @@ function usage {
 
 function processoptions {
     while [[ $# > 0 ]] do
-    case $1 in
-    -V)
+        case $1 in
+        -V)
             print "dotty version 96c (09-24-96)"
-        shift
-        ;;
-    -f)
-        shift
-        loadfile=$1
-        shift
-        ;;
-    -lm)
-        shift
-        LMODE=$1
+                       FLAGS=$FLAGS" -V"
+            shift
+            ;;
+        -f)
+            shift
+            loadfile=$1
+            shift
+            ;;
+        -lt)
+            shift
+            layouttool=$1
+            shift
+            ;;
+        -lm)
+            shift
+            LMODE=$1
             if [[ $LMODE != 'sync' && $LMODE != 'async' ]] then
                 usage
-            exit 1
-        fi
-        shift
-        ;;
-    -el)
-        shift
-        MLEVEL=$1
+                exit 1
+            fi
+            shift
+            ;;
+        -el)
+            shift
+            MLEVEL=$1
             if [[ $MLEVEL != '0' && $MLEVEL != '1' ]] then
                 usage
-            exit 1
-        fi
-        shift
-        ;;
-    -)
-            FILES=$(print $FILES "'"$1"'")
-        shift
-        ;;
-    -*)
+                exit 1
+            fi
+            shift
+            ;;
+        -)
+            FILES[${#FILES[@]}]="'"$1"'"
+            shift
+            ;;
+        -*)
             usage
-        exit 1
-        ;;
-    *)
-            FILES=$(print $FILES "'"$1"'")
-        shift
-        ;;
-    esac
+            exit 1
+            ;;
+        *)
+            FILES[${#FILES[@]}]="'"$1"'"
+            shift
+            ;;
+        esac
     done
 }
 
@@ -73,11 +79,15 @@ if [[ $loadfile != '' ]] then
     CMDS=$(print $CMDS load \("'"$loadfile"'"\)";")
 fi
 
+if [[ $layouttool != '' ]] then
+    CMDS=$(print $CMDS dotty.protogt.lserver = "'$layouttool';")
+fi
+
 if [[ $FILES = '' ]] then
     FILES=null
 fi
 FUNC="dotty.createviewandgraph"
-for i in $FILES; do
+for i in "${FILES[@]}"; do
     CMDS=$(print $CMDS $FUNC \($i, "'"file"'", null, null\)";")
 done
 
@@ -89,7 +99,7 @@ if [[ $leftypath == '' ]] then
     exit 1
 fi
 
-$leftypath -e "
+$leftypath $FLAGS -e "
 load ('dotty.lefty');
 checkpath = function () {
     if (tablesize (dotty) > 0)