15d7a4c2250d99380de5104c2f6ced457f943288

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #614 from philippbosch/feature/terminitor-plugin

terminitor plugin

Diff

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