Debian Codegraph @

tclpkg/tcldot/examples/psdisp

raw
1 #!/bin/sh
2 # next line is a comment in tcl \
3 exec tclsh "$0" ${1+"$@"}
4
5 package require Tkspline
6 package require Tcldot
7
8 # psdisp - display a .gv graph file using ghostview - [email protected]
9 #
10 # Usage: psdisp <file.gv>
11 #
12
13 if {[llength $argv] == 0} {
14 puts "No .gv file specified. Assuming demo."
15 set argv "data/poly.gv"
16 }
17 if {[llength $argv] > 1} {puts "Too many args."; exit}
18 if {[catch {open $argv r} f]} {puts "unable to open .gv file"; exit}
19 set g [dotread $f]
20 close $f
21
22 $g layout
23
24 if {[catch {open "| ghostview -" w} f]} {puts "unable to open output pipe to ghostview"; exit}
25 $g write $f ps
26 close $f