]> git.rmz.io Git - dotfiles.git/blob - zsh/plugins/terminitor/_terminitor
merge oh-my-zsh into subdir
[dotfiles.git] / zsh / plugins / terminitor / _terminitor
1 #compdef terminitor
2 #autoload
3
4 # terminitor zsh completion
5
6 _terminitor_available_scripts() {
7 scripts=(`for SCRIPT in ~/.config/terminitor/*.term ; do basename $SCRIPT .term ; done`)
8 }
9
10 local -a _1st_arguments
11 _1st_arguments=(
12 'create:create a Termfile in directory'
13 'delete:delete terminitor script'
14 'edit:open termitor script'
15 'fetch:clone the designated repo and run setup'
16 'help:Describe available tasks or one specific task'
17 'init:create initial root terminitor folder'
18 'list:lists all terminitor scripts'
19 'setup:execute setup in the terminitor script'
20 'start:runs the terminitor script'
21 'update:update Terminitor to new global path(.config/.terminitor)'
22 )
23
24 local expl
25
26 _arguments \
27 '*:: :->subcmds' && return 0
28
29 if (( CURRENT == 1 )); then
30 _describe -t commands "terminitor task" _1st_arguments
31 return
32 fi
33
34 case "$words[1]" in
35 start|edit|delete|setup)
36 _terminitor_available_scripts
37 _wanted scripts expl 'installed scripts' compadd -a scripts ;;
38 esac