1
0
mirror of https://github.com/go-task/task.git synced 2026-04-26 20:02:40 +02:00
Files
task/completion/bash/task.bash
T

22 lines
446 B
Bash
Raw Normal View History

2019-08-30 09:59:03 +10:00
_task_completion()
{
local scripts;
local curr_arg;
# Remove colon from word breaks
2019-08-30 09:59:03 +10:00
COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
2020-02-19 07:22:37 -05:00
scripts=$(task -l | sed '1d' | awk '{ print $2 }' | sed 's/:$//');
2019-08-30 09:59:03 +10:00
curr_arg="${COMP_WORDS[COMP_CWORD]:-"."}"
# Do not accept more than 1 argument
if [ "${#COMP_WORDS[@]}" != "2" ]; then
return
fi
COMPREPLY=($(compgen -c | echo "$scripts" | grep $curr_arg));
}
complete -F _task_completion task