Files
xen/tools/xl/bash-completion
T
Wei Liu 5258ab0fcc tools: move xl to a dedicated directory
It makes clear distinction between the client (xl) and library (libxl),
which should help design better APIs.  This will also help reduce the
code size in libxl directory.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2017-02-23 17:29:18 +00:00

21 lines
396 B
Plaintext

# Copy this file to /etc/bash_completion.d/xl.sh
_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