From 8098afeefb274c4d4cc5c765c57e1f64ab920b88 Mon Sep 17 00:00:00 2001 From: Deepak Kannan Date: Wed, 3 Feb 2016 15:21:15 +0530 Subject: [PATCH] Add invoker plugin --- plugins/invoker/README.md | 13 ++++++++++ plugins/invoker/_invoker | 52 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 plugins/invoker/README.md create mode 100644 plugins/invoker/_invoker diff --git a/plugins/invoker/README.md b/plugins/invoker/README.md new file mode 100644 index 00000000..f012df38 --- /dev/null +++ b/plugins/invoker/README.md @@ -0,0 +1,13 @@ +# invoker autocomplete plugin + +* Adds autocomplete options for all invoker commands. + +## Requirements + +In order to make this work, you will need to install the invoker gem + +gem install it like: + + gem install invoker + +more details about the gem at http://invoker.codemancers.com and https://github.com/code-mancers/invoker diff --git a/plugins/invoker/_invoker b/plugins/invoker/_invoker new file mode 100644 index 00000000..0e0e89a0 --- /dev/null +++ b/plugins/invoker/_invoker @@ -0,0 +1,52 @@ +#compdef invoker + +# Invoker autocompletion for oh-my-zsh +# Requires: invoker gem installed +# Author: Amitava (https://github.com/abasak) + +local curcontext="$curcontext" state line ret=1 + +_arguments -C \ + '1: :->cmds' \ + '*:: :->args' && ret=0 + +case $state in + cmds) + _values 'invoker command' \ + 'add[Add a program to Invoker server]' \ + 'add_http[Add an external process to Invoker DNS server]' \ + 'help[Describe available commands or one specific command]' \ + 'list[List all running processes]' \ + 'reload[Reload a process managed by Invoker]' \ + 'remove[Stop a process managed by Invoker]' \ + 'setup[Run Invoker setup]' \ + 'start[Start Invoker server]' \ + 'stop[Stop Invoker daemon]' \ + 'tail[Tail a particular process]' \ + 'uninstall[Uninstall Invoker and all installed files]' \ + 'version[Print Invoker version]' + ret=0 + ;; + + args) + case $line[1] in + help) + if (( CURRENT == 2 )); then + _values 'commands' \ + 'add' 'add_http' 'list' 'reload' 'remove' 'setup' 'start' 'stop' 'tail' 'uninstall' 'version' + fi + ret=0 + ;; + + start) + _arguments \ + '(-d --daemon)'{-d,--daemon}'[Daemonize the server into the background]' \ + '(--port)--port[Port series to be used for starting rack servers]' \ + '1:config file:_path_files' + ret=0 + ;; + esac + ;; +esac + +return ret