Allow bash completion to complete tasks in other directories (#1303)
This commit is contained in:
@@ -25,7 +25,14 @@ _just() {
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
elif [[ ${COMP_CWORD} -eq 1 ]]; then
|
||||
local recipes=$(just --summary --color never 2> /dev/null)
|
||||
local recipes=$(just --summary 2> /dev/null)
|
||||
|
||||
if echo "${cur}" | grep -qF '/'; then
|
||||
local path_prefix=$(echo "${cur}" | sed 's/[/][^/]*$/\//')
|
||||
local recipes=$(just --summary 2> /dev/null -- "${path_prefix}")
|
||||
local recipes=$(printf "${path_prefix}%s\t" $recipes)
|
||||
fi
|
||||
|
||||
if [[ $? -eq 0 ]]; then
|
||||
COMPREPLY=( $(compgen -W "${recipes}" -- "${cur}") )
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user