| M. Strobel 2007-04-22, 7:06 pm |
| quynhvanmac@gmail.com schrieb:
> Is there a way to list all procedure/function APIs that are available
> in a giving package that users can use. No, the internal api won't get
> listed. Thanks.
>
Hi,
as has been said already "info commands" is your friend, and will give
you a starting point.
This script lists all available commands:-------------
proc listNamespaceChildren { {ns ::}} {
listNamespaceCommands $ns
set l [namespace children $ns]
if { [llength $l] > 0 } {
foreach {e} $l {
puts "found namespace $e"
listNamespaceChildren $e
}
}
}
proc listNamespaceCommands { {ns ::}} {
if {[string length $ns] < 3} then {set stern "*"} else {set stern "::*" }
puts "---------- \tAll commands / procedures in namespace $ns$stern
\t----------"
puts stdout "[lsort [info commands $ns$stern ]]"
}
listNamespaceChildren ::
------------------
Max
|