2022-02-13 20:20:01 +01:00
|
|
|
# /bin/bash
|
|
|
|
|
2019-08-30 09:59:03 +10:00
|
|
|
_task_completion()
|
|
|
|
{
|
2022-02-13 20:20:01 +01:00
|
|
|
local cur
|
|
|
|
_get_comp_words_by_ref -n : cur
|
2019-08-30 09:59:03 +10:00
|
|
|
|
2022-02-13 20:20:01 +01:00
|
|
|
case "$cur" in
|
|
|
|
--*)
|
|
|
|
local options="$(_parse_help task)"
|
|
|
|
COMPREPLY=( $(compgen -W "$options" -- "$cur") )
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
local tasks="$(task --list-all | awk 'NR>1 { sub(/:$/,"",$2); print $2 }')"
|
|
|
|
COMPREPLY=( $(compgen -W "$tasks" -- "$cur") )
|
|
|
|
;;
|
|
|
|
esac
|
2019-08-30 09:59:03 +10:00
|
|
|
|
2022-02-13 20:20:01 +01:00
|
|
|
__ltrim_colon_completions "$cur"
|
2019-08-30 09:59:03 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
complete -F _task_completion task
|