本帖最后由 sjtusonic 于 2013-11-19 15:42 编辑
回复 6# yueluofenghen
可以实现你说的那种 -item1 value1 -item2 value2格式的:
In the following example, the argHandler procedure accepts an optional argument of each type supported bydefine_proc_attributes, then displays the options and values received: proc argHandler {args} { parse_proc_arguments -args $args results foreach argname [array names results] { echo $argname = $results($argname) } } define_proc_attributes argHandler \ -info Arguments processor \ -define_args { {{-Oos oos help AnOos one_of_string {required value_help {values {a b}}}} {-Int int help AnInt int optional} {-Float float help AFloat float optional} {-Bool "bool help" boolean optional} {-String "string help" AString string optional} {-List "list help" AList list optional}} {-IDup int dup AIDup int {optional merge_duplicates}}} |