Here's an interesting little curiosity for anyone who uses bash instead of sh. Put it in your .bashrc for a somewhat automatic "ondemand" when launching apps from command line.
If the command you type isn't found, bash will fall back onto a function called command_not_found_handle() if it doesn't exist.
This is an example of a command_not_found_handle() that will look in your tcz directory for an extension with the same name as the failed command. If it finds a match, the extension will be loaded, and your command re-run.
Failing that, it will grep the *.tcz.list files (if you have them) and find a match that way. Again, if it finds a match, load the extension and re-execute your command. If grep finds more than one extension matching it's search, proceed at your own risk. Have not tested nor planned for this eventuality.
It took me a total of 20 minutes to write and test, so not guaranteed to work, though it does the job well enough for me.
function command_not_found_handle()
{
TCE_DIR=`cat /opt/.tce_dir`
[ -f ${TCE_DIR}/optional/${1}.tcz ] && (
tce-load -i ${TCE_DIR}/optional/${1}.tcz
(which $1) && $@
exit
)
TCZ=`grep "${1}$" ${TCE_DIR}/optional/*.tcz.list`
[ "${TCZ}" == ""] || (
tce-load -i ${TCZ%.list}
$@
exit
)
}