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
|
|
|
|
|
|
|
|
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]" \
|
|
|
|
"version[shows tmuxinator version number]"
|
|
|
|
ret=0
|
|
|
|
;;
|
|
|
|
args)
|
|
|
|
case $line[1] in
|
2014-08-29 16:40:08 +08:00
|
|
|
start|open|copy|delete|debug)
|
2014-01-03 21:52:33 +08:00
|
|
|
_configs=(`find ~/.tmuxinator -name \*.yml | cut -d/ -f5 | sed s:.yml::g`)
|
2014-08-29 16:40:08 +08:00
|
|
|
[[ -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
|