From: ellson Date: Tue, 18 Oct 2005 18:56:31 +0000 (+0000) Subject: When lefty updated dotty, he assumes ksh and made dotty.sh basically X-Git-Tag: LAST_LIBGRAPH~32^2~7198 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac2aa933300d30fbf88ead4ae9ea4b4dddad496f;p=graphviz When lefty updated dotty, he assumes ksh and made dotty.sh basically a ksh script, and no longer has a dotty.ksh. Moved dotty.sh to dotty.ksh, and restored old vanilla dotty.sh. --- diff --git a/cmd/dotty/dotty.ksh b/cmd/dotty/dotty.ksh index 7ad10ddf3..3bb2b1622 100755 --- a/cmd/dotty/dotty.ksh +++ b/cmd/dotty/dotty.ksh @@ -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)] " @@ -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)