1
0
mirror of https://github.com/go-task/task.git synced 2025-05-31 23:19:42 +02:00

Merge pull request #718 from budimanjojo/master

Fix broken completion when no taskfile is found
This commit is contained in:
Andrey Nering 2022-05-08 17:25:11 -03:00 committed by GitHub
commit 4951a2bf7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,8 @@
function __task_get_tasks --description "Prints all available tasks with their description"
task -l | sed '1d' | awk '{ $1=""; print $0 }' | sed 's/:\ /\t/g' | string trim
set -l output (task -l 2>&1 < /dev/null | sed '1d' | awk '{ $1=""; print $0 }' | sed 's/:\ /\t/g' | string trim | string split0)
if test $output
echo $output
end
end
complete -c task -d 'Runs the specified task(s). Falls back to the "default" task if no task name was specified, or lists all tasks if an unknown task name was