-#!/bin/ksh
-FILES=""
+set -A FILES
MLEVEL="0"
LMODE="async"
+FLAGS=
function usage {
print "usage: dotty [-V] [-lm (sync|async)] [-el (0|1)] <filename>"
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
}
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
exit 1
fi
-$leftypath -e "
+$leftypath $FLAGS -e "
load ('dotty.lefty');
checkpath = function () {
if (tablesize (dotty) > 0)