Changeset 1914
- Timestamp:
- Sep 23, 2010, 3:22:35 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/getopts.tcl
r1913 r1914 128 128 error "missing value for option $first" 129 129 } 130 set params($first) [lrange $args 1 end] 131 set args "" 130 foreach arg [lrange $args 1 end] { 131 if {[string index $arg 0] == "-"} { 132 break 133 } 134 } 135 set idx [lsearch -exact $args $arg] 136 if {$idx == [expr [llength $args] - 1]} { 137 # reached the end of the $args list 138 # with no other -'d arguments 139 set params($first) [lrange $args 1 end] 140 set args "" 141 } else { 142 # there are further -'d arguments to process 143 set params($first) [lrange $args 1 [expr $idx-1]] 144 set args [lrange $args $idx end] 145 } 132 146 } 133 147 }
Note: See TracChangeset
for help on using the changeset viewer.