diff options
Diffstat (limited to 'library')
-rw-r--r-- | library/clock.tcl | 8 | ||||
-rw-r--r-- | library/http/http.tcl | 37 | ||||
-rw-r--r-- | library/opt/optparse.tcl | 4 | ||||
-rw-r--r-- | library/package.tcl | 2 | ||||
-rw-r--r-- | library/tcltest/tcltest.tcl | 6 |
5 files changed, 31 insertions, 26 deletions
diff --git a/library/clock.tcl b/library/clock.tcl index 67d15b1..936759c 100644 --- a/library/clock.tcl +++ b/library/clock.tcl @@ -1229,7 +1229,7 @@ proc ::tcl::clock::scan { args } { return -code error \ -errorcode [list CLOCK badOption $flag] \ "bad option \"$flag\",\ - must be -base, -format, -gmt, -locale or -timezone" + should be -base, -format, -gmt, -locale or -timezone" } } } @@ -4235,7 +4235,7 @@ proc ::tcl::clock::BSearch { list key } { # Parameters: # clockval -- Starting time value # count -- Amount of a unit of time to add -# unit -- Unit of time to add, must be one of: +# unit -- Unit of time to add, should be one of: # years year months month weeks week # days day hours hour minutes minute # seconds second @@ -4297,7 +4297,7 @@ proc ::tcl::clock::add { clockval args } { default { throw [list CLOCK badOption $a] \ "bad option \"$a\",\ - must be -gmt, -locale or -timezone" + should be -gmt, -locale or -timezone" } } } @@ -4361,7 +4361,7 @@ proc ::tcl::clock::add { clockval args } { default { throw [list CLOCK badUnit $unit] \ - "unknown unit \"$unit\", must be \ + "unknown unit \"$unit\", should be \ years, months, weeks, days, hours, minutes or seconds" } } diff --git a/library/http/http.tcl b/library/http/http.tcl index a6b2bfd..f0674d7 100644 --- a/library/http/http.tcl +++ b/library/http/http.tcl @@ -161,13 +161,13 @@ proc http::config {args} { if {[llength $args] == 1} { set flag [lindex $args 0] if {![regexp -- $pat $flag]} { - return -code error "Unknown option $flag, must be: $usage" + return -code error "unknown option $flag, should be: $usage" } return $http($flag) } else { foreach {flag value} $args { if {![regexp -- $pat $flag]} { - return -code error "Unknown option $flag, must be: $usage" + return -code error "unknown option $flag, should be: $usage" } set http($flag) $value } @@ -342,6 +342,7 @@ proc http::geturl {url args} { } set state(-keepalive) $defaultKeepalive set state(-strict) $strict + set state(accepttypes) $http(-accept) # These flags have their types verified [Bug 811170] array set type { -binary boolean @@ -369,12 +370,12 @@ proc http::geturl {url args} { } { unset $token return -code error \ - "Bad value for $flag ($value), must be $type($flag)" + "bad value for $flag ($value), should be $type($flag)" } set state($flag) $value } else { unset $token - return -code error "Unknown option $flag, can be: $usage" + return -code error "unknown option $flag, should be: $usage" } } @@ -384,7 +385,7 @@ proc http::geturl {url args} { set isQuery [info exists state(-query)] if {$isQuery && $isQueryChannel} { unset $token - return -code error "Can't combine -query and -querychannel options!" + return -code error "can't combine -query and -querychannel options!" } # Validate URL, determine the server host and port, and check proxy case @@ -449,7 +450,7 @@ proc http::geturl {url args} { # Phase one: parse if {![regexp -- $URLmatcher $url -> proto user host port srvurl]} { unset $token - return -code error "Unsupported URL: $url" + return -code error "unsupported URL: $url" } # Phase two: validate set host [string trim $host {[]}]; # strip square brackets from IPv6 address @@ -457,13 +458,13 @@ proc http::geturl {url args} { # Caller has to provide a host name; we do not have a "default host" # that would enable us to handle relative URLs. unset $token - return -code error "Missing host part: $url" + return -code error "missing host part: $url" # Note that we don't check the hostname for validity here; if it's # invalid, we'll simply fail to resolve it later on. } if {$port ne "" && $port > 65535} { unset $token - return -code error "Invalid port number: $port" + return -code error "invalid port number: $port" } # The user identification and resource identification parts of the URL can # have encoded characters in them; take care! @@ -479,9 +480,9 @@ proc http::geturl {url args} { # Provide a better error message in this error case if {[regexp {(?i)%(?![0-9a-f][0-9a-f]).?.?} $user bad]} { return -code error \ - "Illegal encoding character usage \"$bad\" in URL user" + "illegal encoding character usage \"$bad\" in URL user" } - return -code error "Illegal characters in URL user" + return -code error "illegal characters in URL user" } } if {$srvurl ne ""} { @@ -505,9 +506,9 @@ proc http::geturl {url args} { # Provide a better error message in this error case if {[regexp {(?i)%(?![0-9a-f][0-9a-f])..} $srvurl bad]} { return -code error \ - "Illegal encoding character usage \"$bad\" in URL path" + "illegal encoding character usage \"$bad\" in URL path" } - return -code error "Illegal characters in URL path" + return -code error "illegal characters in URL path" } } else { set srvurl / @@ -518,7 +519,7 @@ proc http::geturl {url args} { set lower [string tolower $proto] if {![info exists urlTypes($lower)]} { unset $token - return -code error "Unsupported URL type \"$proto\"" + return -code error "unsupported URL type \"$proto\"" } set defport [lindex $urlTypes($lower) 0] set defcmd [lindex $urlTypes($lower) 1] @@ -693,7 +694,7 @@ proc http::Connected { token proto phost srvurl} { } if {[catch { puts $sock "$how $srvurl HTTP/$state(-protocol)" - puts $sock "Accept: $http(-accept)" + puts $sock "Accept: $state(accepttypes)" array set hdrs $state(-headers) if {[info exists hdrs(Host)]} { # Allow Host spoofing. [Bug 928154] @@ -1489,9 +1490,13 @@ proc http::make-transformation-chunked {chan command} { yield while {1} { chan configure $chan -translation {crlf binary} - while {[gets $chan line] < 1} { yield } + while {[gets $chan line] < 1} { + yield + } chan configure $chan -translation {binary binary} - if {[scan $line %x size] != 1} { return -code error "invalid size: \"$line\"" } + if {[scan $line %x size] != 1} { + return -code error "invalid size: \"$line\"" + } set chunk "" while {$size && ![chan eof $chan]} { set part [chan read $chan $size] diff --git a/library/opt/optparse.tcl b/library/opt/optparse.tcl index fc77fa1..3eafa1f 100644 --- a/library/opt/optparse.tcl +++ b/library/opt/optparse.tcl @@ -165,7 +165,7 @@ proc ::tcl::OptKeyRegister {desc {key ""}} { foreach item $desc { if {$state == "args"} { # more items after 'args'... - return -code error "'args' special argument must be the last one" + return -code error "'args' special argument should be the last one" } set res [OptNormalizeOne $item] set state [lindex $res 0] @@ -829,7 +829,7 @@ proc ::tcl::OptCheckType {arg type {typeArgs ""}} { OptError "ambigous option \"$arg\", choose from:" [OptSelection $desc] } proc OptFlagUsage {desc arg} { - OptError "bad flag \"$arg\", must be one of" $desc + OptError "bad flag \"$arg\", should be one of" $desc } proc OptTooManyArgs {desc arguments} { OptError "too many arguments (unexpected argument(s): $arguments),\ diff --git a/library/package.tcl b/library/package.tcl index 52daa0e..db0741e 100644 --- a/library/package.tcl +++ b/library/package.tcl @@ -668,7 +668,7 @@ proc ::tcl::Pkg::Create {args} { set err(wrongNumArgs) "wrong # args: should be \"$err(usage)\"" set err(valueMissing) "value for \"%s\" missing: should be \"$err(usage)\"" set err(unknownOpt) "unknown option \"%s\": should be \"$err(usage)\"" - set err(noLoadOrSource) "at least one of -load and -source must be given" + set err(noLoadOrSource) "at least one of -load and -source should be given" # process arguments set len [llength $args] diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl index 8e43859..d5b9141 100644 --- a/library/tcltest/tcltest.tcl +++ b/library/tcltest/tcltest.tcl @@ -1135,7 +1135,7 @@ proc tcltest::ConstraintInitializer {constraint {script ""}} { } # Check for boolean values if {![info complete $script]} { - return -code error "ConstraintInitializer must be complete script" + return -code error "ConstraintInitializer should be complete script" } set ConstraintInitializer($constraint) $script } @@ -1909,7 +1909,7 @@ proc tcltest::test {name description args} { set sorted [lsort $validFlags] set options [join [lrange $sorted 0 end-1] ", "] append options ", or [lindex $sorted end]" - return -code error "bad option \"$flag\": must be $options" + return -code error "bad option \"$flag\": should be $options" } } @@ -1926,7 +1926,7 @@ proc tcltest::test {name description args} { set values [join [lrange $sorted 0 end-1] ", "] append values ", or [lindex $sorted end]" return -code error "bad -match value \"$match\":\ - must be $values" + should be $values" } # Replace symbolic valies supplied for -returnCodes |