From 98fe4e0cd20deae896796d3c12b916f850fae347 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Tue, 19 Apr 2016 09:52:58 +0200 Subject: [PATCH] Updated tmuxinator bash completion with latest from Git --- bin/tmuxinator.bash | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/tmuxinator.bash b/bin/tmuxinator.bash index 70c047d..476d1e2 100755 --- a/bin/tmuxinator.bash +++ b/bin/tmuxinator.bash @@ -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 }