3 # zsh completion for lldpcli
5 # Copyright (c) 2014 Vincent Bernat <bernat@luffy.cx>
7 # Permission to use, copy, modify, and/or distribute this software for any
8 # purpose with or without fee is hereby granted, provided that the above
9 # copyright notice and this permission notice appear in all copies.
11 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 __lldpcli_command () {
22 completions=(${(f)"$(_call_program commands lldpcli complete ${words[1,$(($CURRENT-1))]})"})
23 completions=(${completions:s/ /:/})
24 _describe -t lldpcli-command "lldpcli completion" completions "$@"
29 '*-d[print more debugging information]' \
30 '(- *)-v[print version number and exit]' \
31 '-u[use an alternate socket with lldpd]:UNIX socket:_files' \
32 '-f[output format]:format:(plain xml json json0 keyvalue)' \
33 '*-c[read a configuration file]:configuration file:_files' \
34 '(-)*::lldpcli command:__lldpcli_command'
43 # indent-tabs-mode: nil
46 # vim: ft=zsh sw=4 ts=4 et