From 2836b8ead9072f694310ca01769047eb2ed6f09d Mon Sep 17 00:00:00 2001 From: Blake Walters Date: Sat, 27 Aug 2011 12:38:22 -0600 Subject: [PATCH 1/2] added completions for lunchy (https://github.com/mperham/lunchy) --- _lunchy | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 _lunchy diff --git a/_lunchy b/_lunchy new file mode 100644 index 0000000..0e4dbce --- /dev/null +++ b/_lunchy @@ -0,0 +1,35 @@ +#compdef lunchy + +local state line cmds ret=1 + +_arguments -C '1: :->cmds' '*: :->args' + +case $state in + cmds) + local -a cmds + cmds=( + 'ls:list available agents' + 'start:start an agent' + 'stop:stop an agent' + 'restart:restart an agent' + 'status:get the status of agent[s]' + 'install:install an agents plist file' + 'edit:edit an agent' + ) + _describe -t commands 'lunchy command' cmds && ret=0 + ;; + args) + case $line[1] in + (install) + ;; + (restart|stop) + _values 'items' `lunchy status | awk '{print $3}' ` 2>/dev/null && ret=0 + ;; + *) + _values 'items' `lunchy ls` 2>/dev/null && ret=0 + ;; + esac + ;; +esac + +return ret From e0787d3614ebc87f48804edb9c8250ff22014d45 Mon Sep 17 00:00:00 2001 From: Blake Walters Date: Sat, 27 Aug 2011 12:48:02 -0600 Subject: [PATCH 2/2] added header block with description and author info --- _lunchy | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/_lunchy b/_lunchy index 0e4dbce..652c186 100644 --- a/_lunchy +++ b/_lunchy @@ -1,4 +1,18 @@ #compdef lunchy +# ------------------------------------------------------------------------------ +# Description +# ----------- +# +# Completion script for lunchy (https://github.com/mperham/lunchy). +# +# +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * Blake Walters (https://github.com/markupboy) +# +# ------------------------------------------------------------------------------ local state line cmds ret=1