2013-11-12 19:05:19 +00:00
|
|
|
#compdef tmuxinator mux
|
2011-12-02 10:32:15 +00:00
|
|
|
#autoload
|
|
|
|
|
|
|
|
local curcontext="$curcontext" state line ret=1
|
|
|
|
local -a _configs
|
|
|
|
|
|
|
|
_arguments -C \
|
|
|
|
'1: :->cmds' \
|
|
|
|
'2:: :->args' && ret=0
|
|
|
|
|
2015-02-03 16:58:09 +00:00
|
|
|
_configs=(${$(echo ~/.tmuxinator/*.yml):r:t})
|
|
|
|
|
2011-12-02 10:32:15 +00:00
|
|
|
case $state in
|
|
|
|
cmds)
|
|
|
|
_values "tmuxinator command" \
|
2014-08-29 08:40:08 +00:00
|
|
|
"new[create a new project file and open it in your editor]" \
|
2011-12-02 10:32:15 +00:00
|
|
|
"start[start a tmux session using project's tmuxinator config]" \
|
|
|
|
"open[create a new project file and open it in your editor]" \
|
|
|
|
"copy[copy source_project project file to a new project called new_project]" \
|
|
|
|
"delete[deletes the project called project_name]" \
|
2014-08-29 08:40:08 +00:00
|
|
|
"debug[output the shell commands generated by a projet]" \
|
2011-12-02 10:32:15 +00:00
|
|
|
"implode[deletes all existing projects!]" \
|
|
|
|
"list[list all existing projects]" \
|
|
|
|
"doctor[look for problems in your configuration]" \
|
|
|
|
"help[shows this help document]" \
|
2015-02-03 16:58:09 +00:00
|
|
|
"version[shows tmuxinator version number]" \
|
|
|
|
$_configs
|
2011-12-02 10:32:15 +00:00
|
|
|
ret=0
|
|
|
|
;;
|
|
|
|
args)
|
|
|
|
case $line[1] in
|
2014-08-29 08:40:08 +00:00
|
|
|
start|open|copy|delete|debug)
|
|
|
|
[[ -n "$_configs" ]] && _values 'configs' $_configs
|
2011-12-02 10:32:15 +00:00
|
|
|
ret=0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2013-11-12 19:05:19 +00:00
|
|
|
return ret
|