47d0735b5fb5e9e82d8fb5d71f4f4c814e977b68

Author
Philipp Bosch <hello@pb.io>
Committer
Philipp Bosch <hello@pb.io>
Date

Message

terminitor plugin: add autocompletion for start subcommand.

Diff

 1diff --git a/plugins/terminitor/_terminitor b/plugins/terminitor/_terminitor
 2index 7d267643b4fcd8299139c4b0ed24a50318bdf94f..0326506eb19a0628283cc9517253ff5450e2d761 100644
 3--- a/plugins/terminitor/_terminitor
 4+++ b/plugins/terminitor/_terminitor
 5@@ -3,6 +3,10 @@
 6 
 7 # terminitor zsh completion
 8 
 9+_terminitor_available_scripts() {
10+  scripts=(`for SCRIPT in ~/.config/terminitor/*.term ; do basename $SCRIPT .term ; done`)
11+}
12+
13 local -a _1st_arguments
14 _1st_arguments=(
15     'create:create a Termfile in directory'
16@@ -17,6 +21,8 @@ _1st_arguments=(
17     'update:update Terminitor to new global path(.config/.terminitor)'
18 )
19 
20+local expl
21+
22 _arguments \
23   '*:: :->subcmds' && return 0
24 
25@@ -24,3 +30,9 @@ if (( CURRENT == 1 )); then
26   _describe -t commands "terminitor task" _1st_arguments
27   return
28 fi
29+
30+case "$words[1]" in
31+  start)
32+    _terminitor_available_scripts
33+    _wanted scripts expl 'installed scripts' compadd -a scripts ;;
34+esac