Changeset 82760
- Timestamp:
- 08/19/11 14:41:40 (4 years ago)
- File:
-
- 1 edited
-
trunk/base/src/port1.0/portutil.tcl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/base/src/port1.0/portutil.tcl
r82291 r82760 133 133 134 134 ## 135 # Handle option-strsed 136 # 137 # @param option name of the option 138 # @param args arguments 139 proc handle_option-strsed {option args} { 140 global $option user_options option_procs 141 142 if {![info exists user_options($option)] && [info exists $option]} { 143 set temp [set $option] 144 foreach val $args { 145 set temp [strsed $temp $val] 146 } 147 set $option $temp 148 } 149 } 150 151 ## 135 152 # Handle option-replace 136 153 # … … 138 155 # @param args arguments 139 156 proc handle_option-replace {option args} { 140 global $option user_options option_procs 157 global $option user_options option_procs deprecated_options 158 159 # Deprecate -replace with only one argument, for backwards compatibility call -strsed 160 # XXX: Remove this in 2.2.0 161 if {[llength $args] == 1} { 162 if {![info exists deprecated_options(${option}-replace)]} { 163 set deprecated_options(${option}-replace) [list ${option}-strsed 0] 164 } 165 set refcount [lindex $deprecated_options(${option}-replace) 1] 166 lset deprecated_options(${option}-replace) 1 [expr $refcount + 1] 167 ui_msg "LOL" 168 return [eval handle_option-strsed $option $args] 169 } 141 170 142 171 if {![info exists user_options($option)] && [info exists $option]} { 143 set temp [set $option] 144 foreach val $args { 145 set temp [strsed $temp $val] 146 } 147 set $option $temp 172 foreach {old new} $args { 173 set index [lsearch -exact [set $option] $old] 174 if {$index == -1} { 175 continue 176 } 177 set $option [lreplace [set $option] $index $index $new] 178 } 148 179 } 149 180 } … … 161 192 interp alias {} $option-append {} handle_option-append $option 162 193 interp alias {} $option-delete {} handle_option-delete $option 194 interp alias {} $option-strsed {} handle_option-strsed $option 163 195 interp alias {} $option-replace {} handle_option-replace $option 164 196 }
Note: See TracChangeset
for help on using the changeset viewer.

