Skip to content

Commit

Permalink
Update completion script
Browse files Browse the repository at this point in the history
  • Loading branch information
casey committed Oct 17, 2020
1 parent 8b02e30 commit 39ab33a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions completions/just.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,19 @@ _just() {
args)
curcontext="${curcontext%:*}-${words[2]}:"

local lastarg=${words[${#words}]}

local cmds; cmds=(
${(s: :)$(_call_program commands just --summary)}
)

# Find first recipe name
integer skip=0
for ((i = 2; i < $#words; i++ )) do
if [[ ${cmds[(I)${words[i]}]} -gt 0 ]]; then
recipe=${words[i]}
break
fi
done

if [[ ${lastarg} = */* ]]; then
if [[ $lastarg = */* ]]; then
# Arguments contain slash would be recognised as a file
_arguments -s -S $common '*:: :_files'
elif [[ $lastarg = *=* ]]; then
Expand Down

0 comments on commit 39ab33a

Please sign in to comment.