From: ian Date: Sun, 1 Jun 2008 22:18:29 +0000 (+0000) Subject: rename testmode setting; permit + in command names X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=7263f30b105e92bb2573a216fd7da49a22ed4a90;p=trains.git rename testmode setting; permit + in command names --- diff --git a/hostside/multiplex b/hostside/multiplex index 1b97aba..feeb6f2 100755 --- a/hostside/multiplex +++ b/hostside/multiplex @@ -247,7 +247,7 @@ proc process-command {conn l} { if {[regexp {^#} $l]} return; # comments ?! ok then ... set l [string trim $l] if {![string length $l]} return - if {![regexp {^((!?)[-a-z0-9]+)(?:\s.*)?$} $l dummy cmd priv]} { + if {![regexp {^((!?)[-+a-z0-9]+)(?:\s.*)?$} $l dummy cmd priv]} { error "improper command name" {} {TRAIN CMDNAK BadCmd} } if {[regexp {[^ \t!-~]} $l]} { @@ -515,10 +515,10 @@ proc clear-replay-detects {} { } proc realtime-inputline {dummy l} { - global detectlag replay cmdstdin + global detectlag replay testmode global executing currentcmd currentconn - if {$cmdstdin && [regexp {^%(.*)} $l dummy rhs]} { + if {$testmode && [regexp {^%(.*)} $l dummy rhs]} { set r [catch { uplevel #0 $rhs } emsg] if {$r} { puts "** $emsg\n" } else { puts "=> $emsg\n" } return @@ -665,17 +665,17 @@ proc binding {addr blist} { } proc startup {} { - global queueing executing cmdstdin realtime port + global queueing executing testmode realtime port catch { close $master }; catch { unset master } - setting cmdstdin 0 {[01]} + setting testmode 0 {[01]} parse-argv {} uplevel #0 source multiplex-config set queueing {} set executing 0 realtime-notrunning-init - if {$cmdstdin} { + if {!$testmode} { start_commandloop } else { fconfig-trainproto stdin