1
0
mirror of https://github.com/aquatix/dotfiles.git synced 2025-12-06 21:45:10 +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() {
COMPREPLY=()
local word="${COMP_WORDS[COMP_CWORD]}"
local word
word="${COMP_WORDS[COMP_CWORD]}"
if [ "$COMP_CWORD" -eq 1 ]; then
local commands="$(compgen -W "$(tmuxinator commands)" -- "$word")"
local projects="$(compgen -W "$(tmuxinator completions start)" -- "$word")"
COMPREPLY=( $commands $projects )
else
local words=("${COMP_WORDS[@]}")
elif [ "$COMP_CWORD" -eq 2 ]; then
local words
words=("${COMP_WORDS[@]}")
unset words[0]
unset words[$COMP_CWORD]
local completions=$(tmuxinator completions "${words[@]}")
local completions
completions=$(tmuxinator completions "${words[@]}")
COMPREPLY=( $(compgen -W "$completions" -- "$word") )
fi
}