From 034d1a88af50bca7929e0b306071f17f6f8e77b7 Mon Sep 17 00:00:00 2001 From: cascade Date: Fri, 5 Mar 2004 20:48:47 +0000 Subject: [PATCH] Bug OCC4062 The filling of development version of WOK doesn't equivalent to release one. resources only --- src/WOKsite/cmd-input.tcl | 95 ++++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 47 deletions(-) diff --git a/src/WOKsite/cmd-input.tcl b/src/WOKsite/cmd-input.tcl index 7702f67..45b9b2b 100755 --- a/src/WOKsite/cmd-input.tcl +++ b/src/WOKsite/cmd-input.tcl @@ -1,58 +1,59 @@ namespace eval CmdInput { - # We want to allow shell commands to execute automatically - # as in normal interactive use. The "unknown" proc checks - # that "info script" returns "", before it enables that - # behaviour, so we subclass "info". In Tcl 8.4 we could simply - # call 'info script ""' I believe, but 8.3 and earlier don't do - # that. - variable this_script [info script] - proc info {args} { - set result [uplevel [concat __org_info $args]] - set cmd [lindex $args 0] + # We want to allow shell commands to execute automatically + # as in normal interactive use. The "unknown" proc checks + # that "info script" returns "", before it enables that + # behaviour, so we subclass "info". In Tcl 8.4 we could simply + # call 'info script ""' I believe, but 8.3 and earlier don't do + # that. + variable this_script [info script] + proc info {args} { + set result [uplevel [concat __org_info $args]] + set cmd [lindex $args 0] - variable this_script - if {"script" == $cmd && "$result" == $this_script} { - return "" - } else { - return $result - } - } - rename ::info ::__org_info ;# using a namespace proc here cores - proc ::info {args} "uplevel \[concat [namespace which info] \$args\]" + variable this_script + if {"script" == $cmd && "$result" == $this_script} { + return "" + } else { + return $result + } + } + rename ::info ::__org_info ;# using a namespace proc here cores + proc ::info {args} "uplevel \[concat [namespace which info] \$args\]" - proc loop {} { - # preparations - fconfigure stdin -buffering line - fconfigure stdout -buffering line - fconfigure stderr -buffering line - set ::tcl_interactive 1 + proc loop {} { + # preparations + fconfigure stdin -buffering line + fconfigure stdout -buffering line + fconfigure stderr -buffering line + set ::tcl_interactive 1 - if {[file exists ~/tclshrc_WOK8.0]} { - namespace eval :: {uplevel \#0 source ~/tclshrc_WOK8.3} - } + if {[file exists ~/tclshrc.tcl]} { + namespace eval :: {uplevel \#0 source ~/tclshrc.tcl} + } - # input loop - while {1} { - catch {uplevel \#0 $::tcl_prompt1} - flush stdout - set cmd {} - while {1} { - append cmd [gets stdin] "\n" - if {[info complete $cmd]} { - break - } - catch {uplevel \#0 $::tcl_prompt2} - flush stdout - } - history add $cmd - catch {uplevel \#0 $cmd} result - puts $result - } - return "" - } + # input loop + while {1} { + catch {uplevel \#0 $::tcl_prompt1} + flush stdout + set cmd {} + while {1} { + append cmd [gets stdin] "\n" + if {[info complete $cmd]} { + break + } + catch {uplevel \#0 $::tcl_prompt2} + flush stdout + } + history add $cmd + catch {uplevel \#0 $cmd} result + puts $result + } + return "" + } } catch {CmdInput::loop} result puts $result exit 0 + -- 2.39.5