7a9bab1d77e2c22c331ce98a7245d0ba5d348353
- Author
- Marc Cornellà <marc.cornella@live.com>
- Committer
- GitHub <noreply@github.com>
- Date
Message
Update tmuxinator completion to 03c8babb
Diff
1diff --git a/plugins/tmuxinator/_tmuxinator b/plugins/tmuxinator/_tmuxinator
2index 551267ed200e34faeeac04fc8cda8f04c5fd9de2..37032f8d8f6db896c3f497c70bf6cdb84c9282cc 100644
3--- a/plugins/tmuxinator/_tmuxinator
4+++ b/plugins/tmuxinator/_tmuxinator
5@@ -1,40 +1,21 @@
6-#compdef tmuxinator mux
7-#autoload
8+_tmuxinator() {
9+ local commands projects
10+ commands=(${(f)"$(tmuxinator commands zsh)"})
11+ projects=(${(f)"$(tmuxinator completions start)"})
12
13-local curcontext="$curcontext" state line ret=1
14-local -a _configs
15-
16-_arguments -C \
17- '1: :->cmds' \
18- '2:: :->args' && ret=0
19-
20-_configs=(${$(echo ~/.tmuxinator/*.yml):r:t})
21-
22-case $state in
23- cmds)
24- _values "tmuxinator command" \
25- "new[create a new project file and open it in your editor]" \
26- "start[start a tmux session using project's tmuxinator config]" \
27- "open[create a new project file and open it in your editor]" \
28- "copy[copy source_project project file to a new project called new_project]" \
29- "delete[deletes the project called project_name]" \
30- "debug[output the shell commands generated by a projet]" \
31- "implode[deletes all existing projects!]" \
32- "list[list all existing projects]" \
33- "doctor[look for problems in your configuration]" \
34- "help[shows this help document]" \
35- "version[shows tmuxinator version number]" \
36- $_configs
37- ret=0
38- ;;
39- args)
40- case $line[1] in
41- start|open|copy|delete|debug)
42- [[ -n "$_configs" ]] && _values 'configs' $_configs
43- ret=0
44- ;;
45+ if (( CURRENT == 2 )); then
46+ _describe -t commands "tmuxinator subcommands" commands
47+ _describe -t projects "tmuxinator projects" projects
48+ elif (( CURRENT == 3)); then
49+ case $words[2] in
50+ copy|debug|delete|open|start)
51+ _arguments '*:projects:($projects)'
52+ ;;
53 esac
54- ;;
55-esac
56+ fi
57+
58+ return
59+}
60
61-return ret
62+compdef _tmuxinator tmuxinator mux
63+alias mux="tmuxinator"