chiark / gitweb /
stest: Print spawn rune on a line by itself
[secnet.git] / stest / common.tcl
index a85239ca1a643b2834120ffe3ac33e3aca87010d..8897bd90da340a99b4529b65e736691673c7cbb9 100644 (file)
@@ -177,7 +177,7 @@ proc spawn-secnet {location site} {
     }
     set argl [list $secnet -dvnc $cf]
     set divertk SECNET_STEST_DIVERT_$site
-    puts -nonewline "spawn"
+    puts "spawn:"
     foreach k [array names env] {
        switch -glob $k {
            SECNET_STEST_DIVERT_* -
@@ -188,8 +188,9 @@ proc spawn-secnet {location site} {
     }
     if {[info exists env($divertk)]} {
        switch -glob $env($divertk) {
-           i {
-               puts " $argl"
+           i - {i *} {
+               regsub {^i} $env($divertk) {} divert_prefix
+               puts "$divert_prefix $argl"
                puts -nonewline "run ^ command, hit return "
                flush stdout
                gets stdin
@@ -198,9 +199,13 @@ proc spawn-secnet {location site} {
            0 - "" {
                puts " $argl"
            }
-           * {
+           /* - ./* {
                puts " $argl"
                set argl [split $env($divertk)]
+               puts "... $argl"
+           }
+           * {
+               error "$divertk not understood"
            }
        }
     }