summaryrefslogtreecommitdiff
path: root/tools/xl/bash-completion
blob: 7c6ed32f88f90af735ff61fa3be5f13044f6a933 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Copy this file to /etc/bash_completion.d/xl

_xl()
{
	local IFS=$'\n,'

	local cur opts xl
	COMPREPLY=()
	cur="${COMP_WORDS[COMP_CWORD]}"
	xl=xl

	if [[ $COMP_CWORD == 1 ]] ; then
		opts=`${xl} help 2>/dev/null | sed '1,4d' | awk '/^ [^ ]/ {print $1}' | sed 's/$/ ,/g'` && COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
		return 0
	fi

	return 0
}

complete -F _xl -o nospace -o default xl