|
|
|
@ -331,26 +331,26 @@ tcl::namespace::eval punk::args {
|
|
|
|
|
parsing and help display. |
|
|
|
|
directives include: |
|
|
|
|
%B%@id%N% ?opt val...? |
|
|
|
|
options: -id <str> |
|
|
|
|
spec-options: -id <str> |
|
|
|
|
%B%@cmd%N% ?opt val...? |
|
|
|
|
options: -name <str> -help <str> |
|
|
|
|
spec-options: -name <str> -help <str> |
|
|
|
|
%B%@leaders%N% ?opt val...? |
|
|
|
|
options: -min <int> -max <int> |
|
|
|
|
spec-options: -min <int> -max <int> |
|
|
|
|
(used for leading args that come before switches/opts) |
|
|
|
|
%B%@opts%N% ?opt val...? |
|
|
|
|
options: -any <bool> |
|
|
|
|
spec-options: -any <bool> |
|
|
|
|
%B%@values%N% ?opt val...? |
|
|
|
|
options: -min <int> -max <int> |
|
|
|
|
spec-options: -min <int> -max <int> |
|
|
|
|
(used for trailing args that come after switches/opts) |
|
|
|
|
%B%@argdisplay%N% ?opt val...? |
|
|
|
|
options: -header <str> (text for header row of table) |
|
|
|
|
-body <str> (text to replace autogenerated arg info) |
|
|
|
|
spec-options: -header <str> (text for header row of table) |
|
|
|
|
-body <str> (text to replace autogenerated arg info) |
|
|
|
|
%B%@doc%N% ?opt val...? |
|
|
|
|
options: -name <str> -url <str> |
|
|
|
|
spec-options: -name <str> -url <str> |
|
|
|
|
%B%@seealso%N% ?opt val...? |
|
|
|
|
options: -name <str> -url <str> (for footer - unimplemented) |
|
|
|
|
spec-options: -name <str> -url <str> (for footer - unimplemented) |
|
|
|
|
|
|
|
|
|
Some other options normally present on custom arguments are available |
|
|
|
|
Some other spec-options normally present on custom arguments are available |
|
|
|
|
to use with the @leaders @opts @values directives to set defaults |
|
|
|
|
for subsequent lines that represent your custom arguments. |
|
|
|
|
These directives should occur in exactly this order - but can be |
|
|
|
@ -361,7 +361,12 @@ tcl::namespace::eval punk::args {
|
|
|
|
|
or using the i <cmd>.. function - an @id with -id <value> is needed. |
|
|
|
|
|
|
|
|
|
All directives can be omitted, in which case every line represents |
|
|
|
|
a custom value or option. |
|
|
|
|
a custom leader, value or option. |
|
|
|
|
All will be leaders by default if no options defined. |
|
|
|
|
If options are defined (by naming with leading dash, or explicitly |
|
|
|
|
specifying @opts) then the definitions prior to the options will be |
|
|
|
|
categorised as leaders, and those following the options will be |
|
|
|
|
categorised as values. |
|
|
|
|
|
|
|
|
|
Custom arguments are defined by using any word at the start of a |
|
|
|
|
line that doesn't begin with @ or - |
|
|
|
@ -369,7 +374,7 @@ tcl::namespace::eval punk::args {
|
|
|
|
|
that @@somearg becomes an argument named @somearg) |
|
|
|
|
|
|
|
|
|
custom leading args, switches/options (names starting with -) |
|
|
|
|
and trailing values also take options: |
|
|
|
|
and trailing values also take spec-options: |
|
|
|
|
|
|
|
|
|
-type <typename> |
|
|
|
|
defaults to string. If no other restrictions |
|
|
|
@ -397,12 +402,22 @@ tcl::namespace::eval punk::args {
|
|
|
|
|
|
|
|
|
|
-optional <boolean> |
|
|
|
|
(defaults to true for flags/switches false otherwise) |
|
|
|
|
For non flag/switch arguments - all arguments with |
|
|
|
|
-optional true must sit consecutively within their group. |
|
|
|
|
ie all optional leader arguments must be together, and all |
|
|
|
|
optional value arguments must be together. Furthermore, |
|
|
|
|
specifying both optional leaders and optional values will |
|
|
|
|
often lead to ambiguous parsing results. Currently, all |
|
|
|
|
optional non-flg/switch arguments should be either at the |
|
|
|
|
trailing end of leaders or the trailing end of values. |
|
|
|
|
Further unambiguous arrangements of optional args may be |
|
|
|
|
made in future - but are currently considered 'unsupported' |
|
|
|
|
-default <value> |
|
|
|
|
-multiple <bool> (for leaders & values defines whether |
|
|
|
|
subsequent received values are stored agains the same |
|
|
|
|
argument name - only applies to final leader or value) |
|
|
|
|
subsequent received values are stored against the same |
|
|
|
|
argument name - only applies to final leader OR final value) |
|
|
|
|
(for options/flags this allows the opt-val pair or solo |
|
|
|
|
flag to appear multiple times - no necessarily contiguously) |
|
|
|
|
flag to appear multiple times - not necessarily contiguously) |
|
|
|
|
-choices {<choicelist>} |
|
|
|
|
A list of allowable values for an argument. |
|
|
|
|
The -default value doesn't have to be in the list. |
|
|
|
@ -438,7 +453,7 @@ tcl::namespace::eval punk::args {
|
|
|
|
|
Max of -1 represents no upper limit. |
|
|
|
|
If <range> allows more than one choice the value is a list |
|
|
|
|
consisting of items in the choices made available through |
|
|
|
|
entries in -choices/-choicegrups. |
|
|
|
|
entries in -choices/-choicegroups. |
|
|
|
|
-minsize (type dependant) |
|
|
|
|
-maxsize (type dependant) |
|
|
|
|
-range (type dependant) |
|
|
|
@ -1667,6 +1682,7 @@ tcl::namespace::eval punk::args {
|
|
|
|
|
" |
|
|
|
|
@leaders -min 0 -max 0 |
|
|
|
|
@opts |
|
|
|
|
-return -default text -choices {text dict} |
|
|
|
|
-form -default 0 -help\ |
|
|
|
|
"Ordinal index or name of command form" |
|
|
|
|
|
|
|
|
@ -1694,7 +1710,7 @@ tcl::namespace::eval punk::args {
|
|
|
|
|
(directives are lines beginning with |
|
|
|
|
@ e.g @id, @cmd etc) |
|
|
|
|
|
|
|
|
|
if -type is @leaders,@opts or @values matches from that type |
|
|
|
|
if -type is leaders,opts or values matches from that type |
|
|
|
|
will be returned. |
|
|
|
|
|
|
|
|
|
if -type is another directive such as @id, @doc etc the |
|
|
|
@ -1706,8 +1722,10 @@ tcl::namespace::eval punk::args {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
proc resolved_def {args} { |
|
|
|
|
#not eating our own dogfood here as far as argument parsing. -id ::punk::args::resolved_def is for documentation/errors only. |
|
|
|
|
set opts [dict create\ |
|
|
|
|
-types {}\ |
|
|
|
|
-return text\ |
|
|
|
|
-types {}\ |
|
|
|
|
-form 0\ |
|
|
|
|
-antiglobs {}\ |
|
|
|
|
-override {}\ |
|
|
|
@ -1743,7 +1761,7 @@ tcl::namespace::eval punk::args {
|
|
|
|
|
} |
|
|
|
|
dict for {k v} $opts { |
|
|
|
|
switch -- $k { |
|
|
|
|
-form - -types - -antiglobs - -override {} |
|
|
|
|
-return - -form - -types - -antiglobs - -override {} |
|
|
|
|
default { |
|
|
|
|
punk::args::parse $args withid ::punk::args::resolved_def |
|
|
|
|
return |
|
|
|
@ -1764,163 +1782,185 @@ tcl::namespace::eval punk::args {
|
|
|
|
|
|
|
|
|
|
variable id_cache_rawdef |
|
|
|
|
set realid [real_id $id] |
|
|
|
|
if {$realid eq ""} { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if {$realid ne ""} { |
|
|
|
|
set deflist [tcl::dict::get $id_cache_rawdef $realid] |
|
|
|
|
set result "" |
|
|
|
|
set specdict [uplevel 1 [list ::punk::args::resolve {*}$deflist]] |
|
|
|
|
set deflist [tcl::dict::get $id_cache_rawdef $realid] |
|
|
|
|
set specdict [uplevel 1 [list ::punk::args::resolve {*}$deflist]] |
|
|
|
|
|
|
|
|
|
set opt_form [dict get $opts -form] |
|
|
|
|
if {[string is integer -strict $opt_form]} { |
|
|
|
|
set formname [lindex [dict get $specdict form_names] $opt_form] |
|
|
|
|
} else { |
|
|
|
|
set formname $opt_form |
|
|
|
|
} |
|
|
|
|
set opt_override [dict get $opts -override] |
|
|
|
|
|
|
|
|
|
#set arg_info [dict get $specdict ARG_INFO] |
|
|
|
|
set arg_info [dict get $specdict FORMS $formname ARG_INFO] |
|
|
|
|
set argtypes [dict create leaders leader opts option values value] |
|
|
|
|
|
|
|
|
|
set opt_antiglobs [dict get $opts -antiglobs] |
|
|
|
|
set directives [lsearch -all -inline -exact -not $::punk::args::argdoc::resolved_def_TYPE_CHOICES *] |
|
|
|
|
set suppressed_directives [list] |
|
|
|
|
set suppressed_args [list] |
|
|
|
|
foreach ag $opt_antiglobs { |
|
|
|
|
foreach d $directives { |
|
|
|
|
if {[string match $ag $d]} { |
|
|
|
|
lappend suppressed_directives $d |
|
|
|
|
} |
|
|
|
|
set opt_form [dict get $opts -form] |
|
|
|
|
if {[string is integer -strict $opt_form]} { |
|
|
|
|
set formname [lindex [dict get $specdict form_names] $opt_form] |
|
|
|
|
} else { |
|
|
|
|
set formname $opt_form |
|
|
|
|
} |
|
|
|
|
set opt_override [dict get $opts -override] |
|
|
|
|
set opt_return [dict get $opts -return] |
|
|
|
|
|
|
|
|
|
#set arg_info [dict get $specdict ARG_INFO] |
|
|
|
|
set arg_info [dict get $specdict FORMS $formname ARG_INFO] |
|
|
|
|
set argtypes [dict create leaders leader opts option values value] |
|
|
|
|
|
|
|
|
|
set opt_antiglobs [dict get $opts -antiglobs] |
|
|
|
|
set directives [lsearch -all -inline -exact -not $::punk::args::argdoc::resolved_def_TYPE_CHOICES *] |
|
|
|
|
set suppressed_directives [list] |
|
|
|
|
set suppressed_args [list] |
|
|
|
|
foreach ag $opt_antiglobs { |
|
|
|
|
foreach d $directives { |
|
|
|
|
if {[string match $ag $d]} { |
|
|
|
|
lappend suppressed_directives $d |
|
|
|
|
} |
|
|
|
|
foreach argname [dict keys $arg_info] { |
|
|
|
|
if {[string match $ag $argname]} { |
|
|
|
|
lappend suppressed_args $argname |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
foreach argname [dict keys $arg_info] { |
|
|
|
|
if {[string match $ag $argname]} { |
|
|
|
|
lappend suppressed_args $argname |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
set suppressed_directives [lsort -unique $suppressed_directives] |
|
|
|
|
set suppressed_args [lsort -unique $suppressed_args] |
|
|
|
|
} |
|
|
|
|
set suppressed_directives [lsort -unique $suppressed_directives] |
|
|
|
|
set suppressed_args [lsort -unique $suppressed_args] |
|
|
|
|
|
|
|
|
|
set included_directives [punk::args::system::punklib_ldiff $directives $suppressed_directives] |
|
|
|
|
set included_directives [punk::args::system::punklib_ldiff $directives $suppressed_directives] |
|
|
|
|
|
|
|
|
|
set globbed [list] |
|
|
|
|
foreach pat $patterns { |
|
|
|
|
set matches [dict keys $arg_info $pat] |
|
|
|
|
lappend globbed {*}$matches |
|
|
|
|
} |
|
|
|
|
set globbed [lsort -unique $globbed] |
|
|
|
|
set included_args [punk::args::system::punklib_ldiff $globbed $suppressed_args] |
|
|
|
|
|
|
|
|
|
foreach type $typelist { |
|
|
|
|
switch -exact -- $type { |
|
|
|
|
* { |
|
|
|
|
if {"@id" in $included_directives} { |
|
|
|
|
if {[dict exists $opt_override @id]} { |
|
|
|
|
append result \n "@id [dict merge [dict create -id [dict get $specdict id]] [dict get $opt_override @id]]" |
|
|
|
|
} else { |
|
|
|
|
append result \n "@id -id [dict get $specdict id]" |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
foreach directive {@package @cmd @doc @seealso @argdisplay} { |
|
|
|
|
set dshort [string range $directive 1 end] |
|
|
|
|
if {"$directive" in $included_directives} { |
|
|
|
|
if {[dict exists $opt_override $directive]} { |
|
|
|
|
append result \n "$directive [dict merge [dict get $specdict ${dshort}_info] [dict get $opt_override $directive]]" |
|
|
|
|
} else { |
|
|
|
|
append result \n "$directive [dict get $specdict ${dshort}_info]" |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#output ordered by leader, option, value |
|
|
|
|
foreach pseudodirective {leaders opts values} tp {leader option value} { |
|
|
|
|
set directive "@$pseudodirective" |
|
|
|
|
switch -- $directive { |
|
|
|
|
@leaders {set defaults_key leaderspec_defaults} |
|
|
|
|
@opts {set defaults_key optspec_defaults} |
|
|
|
|
@values {set defaults_key valspec_defaults} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if {"$directive" in $included_directives} { |
|
|
|
|
if {[dict exists $opt_override "$directive"]} { |
|
|
|
|
append result \n "$directive [dict merge [dict get $specdict $defaults_key] [dict get $opt_override $directive]]" |
|
|
|
|
} else { |
|
|
|
|
append result \n "$directive [dict get $specdict $defaults_key]" |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
set globbed [list] |
|
|
|
|
foreach pat $patterns { |
|
|
|
|
set matches [dict keys $arg_info $pat] |
|
|
|
|
lappend globbed {*}$matches |
|
|
|
|
} |
|
|
|
|
set globbed [lsort -unique $globbed] |
|
|
|
|
set included_args [punk::args::system::punklib_ldiff $globbed $suppressed_args] |
|
|
|
|
|
|
|
|
|
if {$pseudodirective in $included_directives} { |
|
|
|
|
foreach m $included_args { |
|
|
|
|
set argspec [dict get $arg_info $m] |
|
|
|
|
if {[dict get $argspec -ARGTYPE] eq $tp} { |
|
|
|
|
set argspec [dict remove $argspec -ARGTYPE] |
|
|
|
|
if {[dict exists $opt_override $m]} { |
|
|
|
|
append result \n "$m [dict merge $argspec [dict get $opt_override $m]]" |
|
|
|
|
} else { |
|
|
|
|
append result \n "$m $argspec" |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
set result "" |
|
|
|
|
set resultdict [dict create] |
|
|
|
|
foreach type $typelist { |
|
|
|
|
switch -exact -- $type { |
|
|
|
|
* { |
|
|
|
|
if {"@id" in $included_directives} { |
|
|
|
|
if {[dict exists $opt_override @id]} { |
|
|
|
|
append result \n "@id [dict merge [dict create -id [dict get $specdict id]] [dict get $opt_override @id]]" |
|
|
|
|
dict set resultdict @id [dict merge [dict create -id [dict get $specdict id]] [dict get $opt_override @id]] |
|
|
|
|
} else { |
|
|
|
|
append result \n "@id -id [dict get $specdict id]" |
|
|
|
|
dict set resultdict @id [list -id [dict get $specdict id]] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
@id { |
|
|
|
|
if {"@id" in $included_directives} { |
|
|
|
|
#only a single id record can exist |
|
|
|
|
if {[dict exists $opt_override @id]} { |
|
|
|
|
append result \n "@id [dict merge [dict create -id [dict get $specdict id]] [dict get $opt_override @id]]" |
|
|
|
|
foreach directive {@package @cmd @doc @seealso @argdisplay} { |
|
|
|
|
set dshort [string range $directive 1 end] |
|
|
|
|
if {"$directive" in $included_directives} { |
|
|
|
|
if {[dict exists $opt_override $directive]} { |
|
|
|
|
append result \n "$directive [dict merge [dict get $specdict ${dshort}_info] [dict get $opt_override $directive]]" |
|
|
|
|
dict set resultdict $directive [dict merge [dict get $specdict ${dshort}_info] [dict get $opt_override $directive]] |
|
|
|
|
} else { |
|
|
|
|
append result \n "@id -id [dict get $specdict id]" |
|
|
|
|
append result \n "$directive [dict get $specdict ${dshort}_info]" |
|
|
|
|
dict set resultdict $directive [dict get $specdict ${dshort}_info] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@package - @cmd - @doc - @seealso - @argdisplay { |
|
|
|
|
if {"$type" in $included_directives} { |
|
|
|
|
set tp [string range $type 1 end] ;# @package -> package |
|
|
|
|
if {[dict exists $opt_override $type]} { |
|
|
|
|
append result \n "$type [dict merge [dict get $specdict ${tp}_info] [dict get $opt_override $type]]" |
|
|
|
|
} else { |
|
|
|
|
append result \n "$type [dict get $specdict ${tp}_info]" |
|
|
|
|
} |
|
|
|
|
#output ordered by leader, option, value |
|
|
|
|
foreach pseudodirective {leaders opts values} tp {leader option value} { |
|
|
|
|
set directive "@$pseudodirective" |
|
|
|
|
switch -- $directive { |
|
|
|
|
@leaders {set defaults_key leaderspec_defaults} |
|
|
|
|
@opts {set defaults_key optspec_defaults} |
|
|
|
|
@values {set defaults_key valspec_defaults} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@leaders - @opts - @values { |
|
|
|
|
#these are the active defaults for further arguments |
|
|
|
|
if {"$type" in $included_directives} { |
|
|
|
|
switch -- $type { |
|
|
|
|
@leaders {set defaults_key leaderspec_defaults} |
|
|
|
|
@opts {set defaults_key optspec_defaults} |
|
|
|
|
@values {set defaults_key valspec_defaults} |
|
|
|
|
} |
|
|
|
|
if {[dict exists $opt_override $type]} { |
|
|
|
|
append result \n "$type [dict merge [dict get $specdict leaderspec_defaults] [dict get $opt_override $type]]" |
|
|
|
|
|
|
|
|
|
if {"$directive" in $included_directives} { |
|
|
|
|
if {[dict exists $opt_override "$directive"]} { |
|
|
|
|
append result \n "$directive [dict merge [dict get $specdict $defaults_key] [dict get $opt_override $directive]]" |
|
|
|
|
dict set resultdict $directive [dict merge [dict get $specdict $defaults_key] [dict get $opt_override $directive]] |
|
|
|
|
} else { |
|
|
|
|
append result \n "$type [dict get $specdict leaderspec_defaults]" |
|
|
|
|
append result \n "$directive [dict get $specdict $defaults_key]" |
|
|
|
|
dict set resultdict $directive [dict get $specdict $defaults_key] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
leaders - opts - values { |
|
|
|
|
#pseudo-directives |
|
|
|
|
if {$type in $included_directives} { |
|
|
|
|
|
|
|
|
|
if {$pseudodirective in $included_directives} { |
|
|
|
|
foreach m $included_args { |
|
|
|
|
set argspec [dict get $arg_info $m] |
|
|
|
|
if {[dict get $argspec -ARGTYPE] eq [dict get $argtypes $type]} { |
|
|
|
|
if {[dict get $argspec -ARGTYPE] eq $tp} { |
|
|
|
|
set argspec [dict remove $argspec -ARGTYPE] |
|
|
|
|
if {[dict exists $opt_override $m]} { |
|
|
|
|
append result \n "$m [dict merge $argspec [dict get $opt_override $m]]" |
|
|
|
|
dict set resultdict $m [dict merge $argspec [dict get $opt_override $m]] |
|
|
|
|
} else { |
|
|
|
|
append result \n "$m $argspec" |
|
|
|
|
dict set resultdict $m $argspec |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
default { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
@id { |
|
|
|
|
if {"@id" in $included_directives} { |
|
|
|
|
#only a single id record can exist |
|
|
|
|
if {[dict exists $opt_override @id]} { |
|
|
|
|
append result \n "@id [dict merge [dict create -id [dict get $specdict id]] [dict get $opt_override @id]]" |
|
|
|
|
dict set resultdict @id [dict merge [dict create -id [dict get $specdict id]] [dict get $opt_override @id]] |
|
|
|
|
} else { |
|
|
|
|
append result \n "@id -id [dict get $specdict id]" |
|
|
|
|
dict set resultdict @id [list -id [dict get $specdict id]] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@package - @cmd - @doc - @seealso - @argdisplay { |
|
|
|
|
if {"$type" in $included_directives} { |
|
|
|
|
set tp [string range $type 1 end] ;# @package -> package |
|
|
|
|
if {[dict exists $opt_override $type]} { |
|
|
|
|
append result \n "$type [dict merge [dict get $specdict ${tp}_info] [dict get $opt_override $type]]" |
|
|
|
|
dict set resultdict $type [dict merge [dict get $specdict ${tp}_info] [dict get $opt_override $type]] |
|
|
|
|
} else { |
|
|
|
|
append result \n "$type [dict get $specdict ${tp}_info]" |
|
|
|
|
dict set resultdict $type [dict get $specdict ${tp}_info] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@leaders - @opts - @values { |
|
|
|
|
#these are the active defaults for further arguments |
|
|
|
|
if {"$type" in $included_directives} { |
|
|
|
|
switch -- $type { |
|
|
|
|
@leaders {set defaults_key leaderspec_defaults} |
|
|
|
|
@opts {set defaults_key optspec_defaults} |
|
|
|
|
@values {set defaults_key valspec_defaults} |
|
|
|
|
} |
|
|
|
|
if {[dict exists $opt_override $type]} { |
|
|
|
|
append result \n "$type [dict merge [dict get $specdict leaderspec_defaults] [dict get $opt_override $type]]" |
|
|
|
|
dict set resultdict $type [dict merge [dict get $specdict leaderspec_defaults] [dict get $opt_override $type]] |
|
|
|
|
} else { |
|
|
|
|
append result \n "$type [dict get $specdict leaderspec_defaults]" |
|
|
|
|
dict set resultdict $type [dict get $specdict leaderspec_defaults] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
leaders - opts - values { |
|
|
|
|
#pseudo-directives |
|
|
|
|
if {$type in $included_directives} { |
|
|
|
|
foreach m $included_args { |
|
|
|
|
set argspec [dict get $arg_info $m] |
|
|
|
|
if {[dict get $argspec -ARGTYPE] eq [dict get $argtypes $type]} { |
|
|
|
|
set argspec [dict remove $argspec -ARGTYPE] |
|
|
|
|
if {[dict exists $opt_override $m]} { |
|
|
|
|
append result \n "$m [dict merge $argspec [dict get $opt_override $m]]" |
|
|
|
|
dict set resultdict $m [dict merge $argspec [dict get $opt_override $m]] |
|
|
|
|
} else { |
|
|
|
|
append result \n "$m $argspec" |
|
|
|
|
dict set resultdict $m $argspec |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if {$opt_return eq "text"} { |
|
|
|
|
return $result |
|
|
|
|
} else { |
|
|
|
|
return $resultdict |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $result |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|