diff options
Diffstat (limited to 'library/opt')
-rw-r--r-- | library/opt/optparse.tcl | 10 | ||||
-rw-r--r-- | library/opt/pkgIndex.tcl | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/library/opt/optparse.tcl b/library/opt/optparse.tcl index ec5eb30..c9438a0 100644 --- a/library/opt/optparse.tcl +++ b/library/opt/optparse.tcl @@ -11,7 +11,7 @@ package require Tcl 8.2 # When this version number changes, update the pkgIndex.tcl file # and the install directory in the Makefiles. -package provide opt 0.4.4.1 +package provide opt 0.4.5 namespace eval ::tcl { @@ -809,15 +809,15 @@ proc ::tcl::OptCheckType {arg type {typeArgs ""}} { } } - # Auto magic lasy type determination + # Auto magic lazy type determination proc OptGuessType {arg} { - if {[regexp -nocase {^(true|false)$} $arg]} { + if { $arg == "true" || $arg == "false" } { return boolean } - if {[regexp {^(-+)?[0-9]+$} $arg]} { + if {[string is integer -strict $arg]} { return int } - if {![catch {expr {double($arg)}}]} { + if {[string is double -strict $arg]} { return float } return string diff --git a/library/opt/pkgIndex.tcl b/library/opt/pkgIndex.tcl index 754d2ee..c5d3635 100644 --- a/library/opt/pkgIndex.tcl +++ b/library/opt/pkgIndex.tcl @@ -9,4 +9,4 @@ # full path name of this file's directory. if {![package vsatisfies [package provide Tcl] 8.2]} {return} -package ifneeded opt 0.4.4.1 [list source [file join $dir optparse.tcl]] +package ifneeded opt 0.4.5 [list source [file join $dir optparse.tcl]] |