1
0
mirror of https://github.com/aquatix/dotfiles.git synced 2025-12-06 20:35:11 +01:00

Updated tmuxinator bash completion with latest from Git

This commit is contained in:
2016-04-19 09:52:58 +02:00
parent 4a44cd0cf8
commit 98fe4e0cd2

View File

@@ -2,18 +2,21 @@
_tmuxinator() { _tmuxinator() {
COMPREPLY=() COMPREPLY=()
local word="${COMP_WORDS[COMP_CWORD]}" local word
word="${COMP_WORDS[COMP_CWORD]}"
if [ "$COMP_CWORD" -eq 1 ]; then if [ "$COMP_CWORD" -eq 1 ]; then
local commands="$(compgen -W "$(tmuxinator commands)" -- "$word")" local commands="$(compgen -W "$(tmuxinator commands)" -- "$word")"
local projects="$(compgen -W "$(tmuxinator completions start)" -- "$word")" local projects="$(compgen -W "$(tmuxinator completions start)" -- "$word")"
COMPREPLY=( $commands $projects ) COMPREPLY=( $commands $projects )
else elif [ "$COMP_CWORD" -eq 2 ]; then
local words=("${COMP_WORDS[@]}") local words
words=("${COMP_WORDS[@]}")
unset words[0] unset words[0]
unset words[$COMP_CWORD] unset words[$COMP_CWORD]
local completions=$(tmuxinator completions "${words[@]}") local completions
completions=$(tmuxinator completions "${words[@]}")
COMPREPLY=( $(compgen -W "$completions" -- "$word") ) COMPREPLY=( $(compgen -W "$completions" -- "$word") )
fi fi
} }