Changeset 37758 for trunk/base/src
- Timestamp:
- 06/21/08 18:47:12 (5 months ago)
- Files:
-
- 1 modified
-
trunk/base/src/port/port.tcl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/base/src/port/port.tcl
r37757 r37758 1194 1194 1195 1195 proc action_get_usage { action } { 1196 global action_array cmd_ args_array1196 global action_array cmd_opts_array 1197 1197 1198 1198 if {[info exists action_array($action)]} { 1199 1199 set cmds "" 1200 if {[info exists cmd_args_array($action)]} { 1201 foreach cmd $cmd_args_array($action) { 1202 set name [lindex $cmd 0] 1203 set argc [lindex $cmd 1] 1200 if {[info exists cmd_opts_array($action)]} { 1201 foreach opt $cmd_opts_array($action) { 1202 if {[llength $opt] == 1} { 1203 set name $opt 1204 set optc 0 1205 } else { 1206 set name [lindex $opt 0] 1207 set optc [lindex $opt 1] 1208 } 1204 1209 1205 1210 append cmds " --$name" 1206 1211 1207 for {set i 1} {$i <= $ argc} {incr i} {1212 for {set i 1} {$i <= $optc} {incr i} { 1208 1213 append cmds " <arg$i>" 1209 1214 } … … 2625 2630 } 2626 2631 2627 # cmd_ args_array specifies which arguments the commands accept2632 # cmd_opts_array specifies which arguments the commands accept 2628 2633 # Commands not listed here do not accept any arguments 2629 2634 # Syntax if {option argn} 2630 2635 # Where option is the name of the option and argn specifies how many arguments 2631 2636 # this argument takes 2632 global cmd_ args_array2633 array set cmd_ args_array {2637 global cmd_opts_array 2638 array set cmd_opts_array { 2634 2639 edit {{editor 1}} 2635 2640 ed {{editor 1}} … … 2654 2659 # this option 2655 2660 proc cmd_option_exists { action option {upoptargc ""}} { 2656 global cmd_ args_array2661 global cmd_opts_array 2657 2662 upvar 1 $upoptargc optargc 2658 2663 … … 2660 2665 # but that's only available as of Tcl 8.5 2661 2666 2662 if {![info exists cmd_ args_array($action)]} {2667 if {![info exists cmd_opts_array($action)]} { 2663 2668 return 0 2664 2669 } 2665 2670 2666 foreach item $cmd_ args_array($action) {2671 foreach item $cmd_opts_array($action) { 2667 2672 if {[llength $item] == 1} { 2668 2673 set name $item … … 2693 2698 upvar $ui_options_name ui_options 2694 2699 upvar $global_options_name global_options 2695 global cmdname cmd_ args_array2700 global cmdname cmd_opts_array 2696 2701 2697 2702 while {[moreargs]} {

