| 1 |
# udisksctl(1) completion -*- shell-script -*- |
| 2 |
|
| 3 |
_udisksctl() { |
| 4 |
local IFS=$'\n' |
| 5 |
local cur=`_get_cword :` |
| 6 |
|
| 7 |
local suggestions=$(udisksctl complete "${COMP_LINE}" ${COMP_POINT}) |
| 8 |
if [ "$suggestions" = "@FILES@" ] ; then |
| 9 |
_filedir |
| 10 |
else |
| 11 |
COMPREPLY=($(compgen -W "$suggestions" -- "$cur")) |
| 12 |
fi |
| 13 |
|
| 14 |
# Remove colon-word prefix from COMPREPLY items |
| 15 |
case "$cur" in |
| 16 |
*:*) |
| 17 |
case "$COMP_WORDBREAKS" in |
| 18 |
*:*) |
| 19 |
local colon_word=${cur%${cur##*:}} |
| 20 |
local i=${#COMPREPLY[*]} |
| 21 |
while [ $((--i)) -ge 0 ]; do |
| 22 |
COMPREPLY[$i]=${COMPREPLY[$i]#"$colon_word"} |
| 23 |
done |
| 24 |
;; |
| 25 |
esac |
| 26 |
;; |
| 27 |
esac |
| 28 |
} && |
| 29 |
complete -o nospace -F _udisksctl udisksctl |