@echo off
set _opt=
if not '%1'=='-s' if not '%1'=='-i' goto continue
set _opt=%1
shift
:continue
set _kdb=..\keywords.kdb
if exist %_kdb% goto kdb
set _kdb=..\%_kdb%
if exist %_kdb% goto kdb
set _kdb=..\%_kdb%
if exist %_kdb% goto kdb
set _kdb=..\%_kdb%
if exist %_kdb% goto kdb
set _kdb=..\index.db
if exist %_kdb% goto idb
set _kdb=..\%_kdb%
if exist %_kdb% goto idb
set _kdb=..\%_kdb%
if exist %_kdb% goto idb
set _kdb=..\%_kdb%
if exist %_kdb% goto idb
linkhtml >symlinks.txt
goto end
:kdb
echo Making symbolic links (using keyword database) for
cd
fdhtmkdb %1 <%_kdb% | mkhtmslk -eavi -emov -empg -erm %_opt% >symlinks.txt
goto end
:idb
echo Making symbolic links (using index database) for
cd
fdhtmkdb %1 <%_kdb% | idb2kdb | mkhtmslk -eavi -emov -empg -erm %_opt% >symlinks.txt
:end
set _kdb=
set _opt=
