Files
tmuxinator/completion/tmuxinator.bash
Andrew Kofink 25c2134f7d Remove mux alias in Bash completion file (#906)
Co-authored-by: Edwin Kofler <edwin@kofler.dev>
2024-03-30 17:59:34 -04:00

23 lines
668 B
Bash

_tmuxinator() {
COMPREPLY=()
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 )
elif [ "$COMP_CWORD" -eq 2 ]; then
local words
words=("${COMP_WORDS[@]}")
unset words[0]
unset words[$COMP_CWORD]
local completions
completions=$(tmuxinator completions "${words[@]}")
COMPREPLY=( $(compgen -W "$completions" -- "$word") )
fi
}
complete -F _tmuxinator tmuxinator