I am working with some legacy TCL scripts that use auto_mkindex
. To understand how it works, I have set up a minimal example but have not been able to correctly source the files. My starting files are
.
├── main.tcl
└── util
└── hello.tcl
The file contents are:
# main.tcl
puts [hello]
# hello.tcl
proc hello {} {
return "Hello World"
}
In ./util
I ran auto_mkindex .
from tclsh
which generated a tclIndex
file in ./util
with the line
set auto_index(hello) [list source [file join $dir hello.tcl]]
Then when using tclsh
from the root of the project I append auto_path
with the path to the util
directory. However, when I call hello
I get an error saying Invalid command name "hello"
. Clearly I'm missing something. What is it?
env TCLLIBPATH="$TCLLIBPATH ./util" tclsh main.tcl
– glenn jackmanauto_path
. – mentoc3000