+proc main/automatic {} {
+ fconfigure stdin -blocking no
+ fileevent stdin readable required
+}
+proc done/automatic {} {
+ exec sh -c {printf \\0 >&4}
+ fileevent stdin readable required
+}
+
+switch -exact -- $argv {
+ {} { set mainkind test }
+ {--automatic 1} { set mainkind automatic }
+ {--automatic*} { error "incompatible versions - install problem" }
+ default { error "huh $argv ?" }
+}
+