1
0
mirror of https://github.com/aquatix/dotfiles.git synced 2025-12-06 21:45:10 +01:00

Bash autocompletion for tmuxinator

This commit is contained in:
Michiel Scholten
2014-08-02 09:07:48 +02:00
parent 937aa25e13
commit b5adbef28f

21
bin/tmuxinator.bash Executable file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
_tmuxinator() {
COMPREPLY=()
local 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[@]}")
unset words[0]
unset words[$COMP_CWORD]
local completions=$(tmuxinator completions "${words[@]}")
COMPREPLY=( $(compgen -W "$completions" -- "$word") )
fi
}
complete -F _tmuxinator tmuxinator mux