From e79026b840a6125541e85bcbd0e094c8d20495c4 Mon Sep 17 00:00:00 2001 From: Guillaume AMAT Date: Sat, 2 Mar 2019 01:40:31 +0100 Subject: [PATCH 1/3] Fix the zsh completion with sub-tasks --- completion/zsh/_task | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 completion/zsh/_task diff --git a/completion/zsh/_task b/completion/zsh/_task old mode 100644 new mode 100755 index 438465ce..cd5f8c12 --- a/completion/zsh/_task +++ b/completion/zsh/_task @@ -5,7 +5,7 @@ function __list() { local -a scripts if [ -f Taskfile.yml ]; then - scripts=($(task -l | sed '1d' | sed 's/://' | awk '{ print $2 }')) + scripts=($(task -l | sed '1d' | sed 's/^* //' | sed 's/\:\s.*//' | sed 's/\(\w\):\(\w\)/\1\\\:\2/')) _describe 'script' scripts fi } From c2f4a57e028558f46114c8044eb7a0d001f18843 Mon Sep 17 00:00:00 2001 From: Guillaume AMAT Date: Sun, 3 Mar 2019 23:32:35 +0100 Subject: [PATCH 2/3] Remove \s for MacOS compatibility, use awk instead --- completion/zsh/_task | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/completion/zsh/_task b/completion/zsh/_task index cd5f8c12..aca0f12a 100755 --- a/completion/zsh/_task +++ b/completion/zsh/_task @@ -5,7 +5,7 @@ function __list() { local -a scripts if [ -f Taskfile.yml ]; then - scripts=($(task -l | sed '1d' | sed 's/^* //' | sed 's/\:\s.*//' | sed 's/\(\w\):\(\w\)/\1\\\:\2/')) + scripts=($(task -l | sed '1d' | sed 's/^\* //' | awk '{ print $1 }' | sed 's/:$//' | sed 's/:/\\:/')) _describe 'script' scripts fi } @@ -23,3 +23,4 @@ _arguments \ '(-w --watch)'{-w,--watch} \ '(- *)'{-h,--help} \ '*: :__list' \ + From 15c0381c3c81b8b314138aec16f3472fa98b0415 Mon Sep 17 00:00:00 2001 From: Guillaume AMAT Date: Mon, 4 Mar 2019 07:03:06 +0100 Subject: [PATCH 3/3] Fix the indentation --- completion/zsh/_task | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completion/zsh/_task b/completion/zsh/_task index aca0f12a..7e6b028e 100755 --- a/completion/zsh/_task +++ b/completion/zsh/_task @@ -5,7 +5,7 @@ function __list() { local -a scripts if [ -f Taskfile.yml ]; then - scripts=($(task -l | sed '1d' | sed 's/^\* //' | awk '{ print $1 }' | sed 's/:$//' | sed 's/:/\\:/')) + scripts=($(task -l | sed '1d' | sed 's/^\* //' | awk '{ print $1 }' | sed 's/:$//' | sed 's/:/\\:/')) _describe 'script' scripts fi }