# Configures KScope parameters

function find_cscope
{
	which cscope
}

function find_ctags
{
	for f in ctags ctags-exuberant exuberant-ctags
	do
		CTAGS_FILE=`which $f`
		if [ "$CTAGS_FILE" ]
		then
			CTAGS_EXUB=`$CTAGS_FILE --help | grep -i exuberant`
			if [ "$CTAGS_EXUB" ]
			then
				echo $CTAGS_FILE
				exit
			fi
		fi
	done
}

function check_cscope_verb
{
	CSCOPE_VERB=`cscope -h 2>&1 | grep ^"-v"`
	if [ "$CSCOPE_VERB" ]
	then
			echo yes
	else
			echo no
	fi
}

if [ $# -lt 1 ]
then
        exit
fi

if [ $1 = "cscope" ]
then
	find_cscope
elif [ $1 = "ctags" ]
then
	find_ctags
elif [ $1 = "cscope_verb" ]
then	
	check_cscope_verb
fi
	