#!/bin/bash
######################################
##
## provides:
## THEME_LIST[]
##
######################################

function _bashish_list
{
	local n=0
	function _bashish_list
	{
		local DIR
		for DIR in "$1"/*
		do
			test "x${DIR}" != "x/*" && \
			if test -f "${DIR}/theme"
			then
				THEME_LIST[$n]="${DIR}"
				let n++
			elif test -d "${DIR}"
			then
				_bashish_list "${DIR}"
			fi
		done
	}
	_bashish_list "$HOME/.bashish/themes"
	_bashish_list "$BASHISHDIR/themes"
	unset -f _bashish_list
}
_bashish_list
