mirror of
https://github.com/go-task/task.git
synced 2025-10-08 23:02:02 +02:00
fix: autocomplete from subfolder works as expected in zsh shell (#2425)
This commit is contained in:
@@ -16,21 +16,18 @@ function __task_list() {
|
|||||||
|
|
||||||
|
|
||||||
if [[ -n "$taskfile" && -f "$taskfile" ]]; then
|
if [[ -n "$taskfile" && -f "$taskfile" ]]; then
|
||||||
enabled=1
|
|
||||||
cmd+=(--taskfile "$taskfile")
|
cmd+=(--taskfile "$taskfile")
|
||||||
else
|
fi
|
||||||
for taskfile in {T,t}askfile{,.dist}.{yaml,yml}; do
|
|
||||||
if [[ -f "$taskfile" ]]; then
|
|
||||||
enabled=1
|
if output=$("${cmd[@]}" $_GO_TASK_COMPLETION_LIST_OPTION 2>/dev/null); then
|
||||||
break
|
enabled=1
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
(( enabled )) || return 0
|
(( enabled )) || return 0
|
||||||
|
|
||||||
scripts=()
|
scripts=()
|
||||||
for item in "${(@)${(f)$("${cmd[@]}" $_GO_TASK_COMPLETION_LIST_OPTION)}[2,-1]#\* }"; do
|
for item in "${(@)${(f)output}[2,-1]#\* }"; do
|
||||||
task="${item%%:[[:space:]]*}"
|
task="${item%%:[[:space:]]*}"
|
||||||
desc="${item##[^[:space:]]##[[:space:]]##}"
|
desc="${item##[^[:space:]]##[[:space:]]##}"
|
||||||
scripts+=( "${task//:/\\:}:$desc" )
|
scripts+=( "${task//:/\\:}:$desc" )
|
||||||
|
Reference in New Issue
Block a user