#!/bin/sh

echo "# Tcl autoload index file, version 2.0" > tclIndex
echo "# This file is generated by the \"auto_mkindex\" command" >> tclIndex
echo "# and sourced to set up indexing information for one or" >> tclIndex
echo "# more commands.  Typically each line is a command that" >> tclIndex
echo "# sets an element in the auto_index array, where the" >> tclIndex
echo "# element name is the name of a command and the value is" >> tclIndex
echo "# a script that loads the command." >> tclIndex
echo "" >> tclIndex

grep '^proc' *.tcl /dev/null | sed -e 's/:proc//' | awk '{ printf("set auto_index(%s) \"source $dir/%s\"\n", $2, $1); }' >> tclIndex
