Command to list all source files in TCL
1 answer
No, but you can override the command source
to track files source
' d somewhere, for example:
rename source __real_source
proc source args {
global sourced
lappend sourced $args
uplevel 1 [linsert $args 0 __real_source]
}
Update: Expanding on Donal's comment regarding the fragility of the command source
where the execution trace can be configured:
proc register_sourced {cmd args} {
global sourced
lappend sourced [lindex $cmd end]
}
trace add execution source leave register_sourced
+7
source to share