slackbuilds_ponce/office/khal/khal-complete.bash
Tonus 749fa6c6fa
office/khal: Updated for version 0.10.5. New email.
Signed-off-by: Dave Woodfall <dave@slackbuilds.org>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2022-07-02 09:55:36 +07:00

29 lines
660 B
Bash

_khal_completion() {
local IFS=$'\n'
local response
response=$(env COMP_WORDS="${COMP_WORDS[*]}" COMP_CWORD=$COMP_CWORD _KHAL_COMPLETE=bash_complete $1)
for completion in $response; do
IFS=',' read type value <<< "$completion"
if [[ $type == 'dir' ]]; then
COMPREPLY=()
compopt -o dirnames
elif [[ $type == 'file' ]]; then
COMPREPLY=()
compopt -o default
elif [[ $type == 'plain' ]]; then
COMPREPLY+=($value)
fi
done
return 0
}
_khal_completion_setup() {
complete -o nosort -F _khal_completion khal
}
_khal_completion_setup;