From c4e8ca4b32e71f4713a18fd0f63f66580fcf07d8 Mon Sep 17 00:00:00 2001 From: Carl Smedstad Date: Sun, 22 May 2022 16:50:47 +0200 Subject: [PATCH] Enable fish tab completion for tasks without description --- completion/fish/task.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/completion/fish/task.fish b/completion/fish/task.fish index 8e5b5fc2..c0c11f9d 100644 --- a/completion/fish/task.fish +++ b/completion/fish/task.fish @@ -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)"