mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
Files in the bash-completion dirs should be named like the commands,
without suffix. Without this change 'xl' will not be recognized as a
command with completion support if BASH_COMPLETION_DIR is set to
/usr/share/bash-completion/completions.
Fixes: 9136a919b ("xl: Add basic bash completion for xl command.")
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
21 lines
393 B
Plaintext
21 lines
393 B
Plaintext
# 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
|