+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 { set mainkind automatic }
+ default { error "huh $argv ?" }
+}
+