# Script for gvmap pipeline
# Use -A to add flags for gvmap; e.g., -Ae results in gvmap -e
# -K can be used to change the original layout; by default, sfdp is used
# -T is used to specify the final output format
# -G, -N and -E flags can be used to tailor the rendering
# -g, -n and -e flags can be used to tailor the initial layout
# Be careful of spaces in the flags. If these are not wrapped in quotes, the
# parts will be separated during option processing.
trap 'rm -f $TMPFILE1 $TMPFILE2 $TMPINFILE errout; exit' 0 1 2 3 15
OPTSTR="vVA:[gvmap flags]G:[attr=val]E:[attr=val]N:[attr=val]g:[attr=val]e:[attr=val]n:[attr=val]K:[layout]T:[output format]o:[outfile]"
while getopts ":$OPTSTR" c
FLAGS2="$FLAGS2 -$OPTARG"
FLAGS3="$FLAGS3 -T$OPTARG"
FLAGS1="$FLAGS1 -E$OPTARG"
FLAGS1="$FLAGS1 -N$OPTARG"
FLAGS1="$FLAGS1 -G$OPTARG"
FLAGS3="$FLAGS3 -E$OPTARG"
FLAGS3="$FLAGS3 -N$OPTARG"
FLAGS3="$FLAGS3 -G$OPTARG"
FLAGS3="$FLAGS3 -o$OPTARG"
print -u 2 $OPTARG requires a value
if [[ "$OPTARG" == '?' ]]
getopts -a gvmap "$OPTSTR" x '-?'
print -u 2 "gvmap: unknown flag $OPTARG - ignored"
print -u 2 "$LAYOUT -Goverlap=prism $FLAGS1 | gvmap $FLAGS2 | neato -n2 $FLAGS3"
$LAYOUT -Goverlap=prism $FLAGS1 | gvmap $FLAGS2 | neato -n2 $FLAGS3
print -u 2 "$LAYOUT -Goverlap=prism $FLAGS1 $1 | gvmap $FLAGS2 | neato -n2 $FLAGS3"
$LAYOUT -Goverlap=prism $FLAGS1 $1 | gvmap $FLAGS2 | neato -n2 $FLAGS3
print -u 2 "gvmap: unknown input file $1 - ignored"