2013-11-13 03:05:19 +08:00
|
|
|
#compdef tmuxinator mux
|
2011-12-02 18:32:15 +08:00
|
|
|
#autoload
|
|
|
|
|
|
|
|
local curcontext="$curcontext" state line ret=1
|
|
|
|
local -a _configs
|
|
|
|
|
|
|
|
_arguments -C \
|
|
|
|
'1: :->cmds' \
|
|
|
|
'2:: :->args' && ret=0
|
|
|
|
|
2015-02-04 00:58:09 +08:00
|
|
|
_configs=(${$(echo ~/.tmuxinator/*.yml):r:t})
|
|
|
|
|
2011-12-02 18:32:15 +08:00
|
|
|
case $state in
|
|
|
|
cmds)
|
|
|
|
_values "tmuxinator command" \
|
2014-08-29 16:40:08 +08:00
|
|
|
"new[create a new project file and open it in your editor]" \
|
2011-12-02 18:32:15 +08: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 16:40:08 +08:00
|
|
|
"debug[output the shell commands generated by a projet]" \
|
2011-12-02 18:32:15 +08: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-04 00:58:09 +08:00
|
|
|
"version[shows tmuxinator version number]" \
|
|
|
|
$_configs
|
2011-12-02 18:32:15 +08:00
|
|
|
ret=0
|
|
|
|
;;
|
|
|
|
args)
|
|
|
|
case $line[1] in
|
2014-08-29 16:40:08 +08:00
|
|
|
start|open|copy|delete|debug)
|
|
|
|
[[ -n "$_configs" ]] && _values 'configs' $_configs
|
2011-12-02 18:32:15 +08:00
|
|
|
ret=0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2013-11-13 03:05:19 +08:00
|
|
|
return ret
|