User Tools

Site Tools


en:linux:scripts:cr_completition

/mnt/pctotem31/bin/cr_completition

Settings for bash completition related to cr

_crcomp()
{
	str="$2"
	file=${str##*/}
	dir=${str%$file}

	searchDirs=( "."  "$CMSSW_BASE/src" "$CMSSW_BASE/user")

	COMPREPLY=()
	for sDir in ${searchDirs[@]}
	do
		RESULT=$(ls "$sDir/$dir" 2> /dev/null|grep "^$file"|sed "s|^|$dir|")
		COMPREPLY=( ${COMPREPLY[@]} $RESULT )
	done
}

complete -o nospace -F _crcomp cr
en/linux/scripts/cr_completition.txt · Last modified: 2010/01/19 14:19 (external edit)