4 print("usage: lua run.lua FILE")
9 -- For simple formatted printing
11 local function printf(fmt
, ...)
12 print(string.format(fmt
, ...))
15 local function gshow(g
)
16 local fn
= os
.tmpname() .. ".dot"
18 os
.execute("dotty "..fn
)
22 -- Provide simple reference for frequently used functions (optional)
23 node
, edge
, subgraph
, cluster
, digraph
, strictdigraph
, ugraph
=
24 gr
.node
, gr
.edge
, gr
.subgraph
, gr
.cluster
, gr
.digraph
, gr
.strictdigraph
, gr
.graph
26 local f
, err
= assert(loadfile(arg
[1]))
29 printf("Generated 'dot' format:")