1
0
mirror of https://github.com/go-task/task.git synced 2025-02-13 13:59:32 +02:00

Enable fish tab completion for tasks without description

This commit is contained in:
Carl Smedstad 2022-05-22 16:50:47 +02:00
parent c9aec2f281
commit c4e8ca4b32
No known key found for this signature in database
GPG Key ID: 5EED78D7F779E010

View File

@ -1,11 +1,11 @@
function __task_get_tasks --description "Prints all available tasks with their description"
set -l output (task -l 2>&1 < /dev/null | sed '1d' | awk '{ $1=""; print $0 }' | sed 's/:\ /\t/g' | string trim | string split0)
set -l output (task --list-all | sed '1d; s/\* \(.*\):\s*\(.*\)/\1\t\2/' | 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
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
specified.' -xa "(__task_get_tasks)"