]> src.twobees.de Git - dotfiles.git/blob - stow/oh-my-zsh/.oh-my-zsh/plugins/terminitor/_terminitor
3615350e264c48ae6f07e8bd019b25bd0bd554d9
[dotfiles.git] / stow / oh-my-zsh / .oh-my-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 terminitor 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