Skip to content

Commit

Permalink
Merge branch 'master' of github.com:thought-machine/please
Browse files Browse the repository at this point in the history
  • Loading branch information
pebers committed Feb 11, 2016
2 parents 00dda2d + f3f50f1 commit 73e83be
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions src/misc/plz_complete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,15 @@
_PleaseCompleteMe() {
local cur
COMPREPLY=()
_get_comp_words_by_ref -n "/:" cur
_get_comp_words_by_ref -n : cur

if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W "`plz --help 2>&1 | grep -Eo -- '--?[a-z_]+'`" -- $cur ) )
if [[ "$cur" == -* || "$COMP_CWORD" == "1" || ("$COMP_CWORD" == "2" && "${COMP_WORDS[1]}" == "query")]]; then
COMPREPLY=( $( compgen -W "`GO_FLAGS_COMPLETION=1 plz ${cur}`" -- $cur) )
else
if [[ "$COMP_CWORD" == "1" ]]; then
COMPREPLY=( $( compgen -W "build test cover query clean run update" -- $cur ) )
else
if [[ "$COMP_CWORD" == "2" && "${COMP_WORDS[1]}" == "query" ]]; then
COMPREPLY=( $( compgen -W "somepath alltargets deps print completions affectedtests input output" -- $cur ) )
else
local IFS=$'\n'
COMPREPLY=( $( compgen -W "`plz --noupdate -p query completions --cmd ${COMP_WORDS[1]} $cur 2>/dev/null`" -- $cur ) )
unset IFS
fi
fi
COMPREPLY=( $( compgen -W "`plz --noupdate -p query completions --cmd ${COMP_WORDS[1]} $cur 2>/dev/null`" -- $cur ) )
fi
__ltrim_colon_completions "$cur"
return 0
}

complete -F _PleaseCompleteMe -o filenames plz
COMP_WORDBREAKS=${COMP_WORDBREAKS//:}

0 comments on commit 73e83be

Please sign in to comment.