/[gentoo-x86]/net-misc/lldpd/files/lldpd-0.7.10-completions.patch
Gentoo

Contents of /net-misc/lldpd/files/lldpd-0.7.10-completions.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download) (as text)
Mon Oct 13 18:06:06 2014 UTC (5 years, 4 months ago) by chutzpah
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
File MIME type: text/x-diff
FILE REMOVED
Revision bump, make sure to pass LLDPD_OPTS to the command line (bug #525190). Remove old.

(Portage version: 2.2.14_rc1/cvs/Linux x86_64, signed Manifest commit with key 0xE3F69979BB4B8928DA78E3D17CBF44EF)

1 chutzpah 1.1 diff --git a/src/client/Makefile.am b/src/client/Makefile.am
2     index af747ea..f7305db 100644
3     --- a/src/client/Makefile.am
4     +++ b/src/client/Makefile.am
5     @@ -39,3 +39,9 @@ lldpcli_SOURCES += jsonc_writer.c
6     lldpcli_CFLAGS += @JSONC_CFLAGS@
7     lldpcli_LDADD += @JSONC_LIBS@
8     endif
9     +
10     +# Completions
11     +bashcompletiondir = $(sysconfdir)/bash_completion.d
12     +bashcompletion_DATA = lldpcli.bash-completion
13     +zshcompletiondir = $(datadir)/zsh/vendor-completions
14     +zshcompletion_DATA = _lldpcli
15     diff --git a/src/client/_lldpcli b/src/client/_lldpcli
16     new file mode 100644
17     index 0000000..9f7a98a
18     --- /dev/null
19     +++ b/src/client/_lldpcli
20     @@ -0,0 +1,40 @@
21     +#compdef lldpcli
22     +#
23     +# zsh completion for lldpcli
24     +#
25     +# Copyright (c) 2014 Vincent Bernat <bernat@luffy.cx>
26     +#
27     +# Permission to use, copy, modify, and/or distribute this software for any
28     +# purpose with or without fee is hereby granted, provided that the above
29     +# copyright notice and this permission notice appear in all copies.
30     +#
31     +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
32     +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
33     +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
34     +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
35     +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
36     +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
37     +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
38     +
39     +
40     +__lldpcli_command () {
41     + local -a completions
42     + completions=(${(f)"$(_call_program commands lldpcli complete ${words[1,$(($CURRENT-1))]})"})
43     + completions=(${completions:s/ /:/})
44     + _describe -t lldpcli-command "lldpcli completion" completions "$@"
45     +}
46     +
47     +_lldpcli () {
48     + local curcontext="$curcontext" state line
49     +
50     + _arguments -C \
51     + '*-d[print more debugging information]' \
52     + '(- *)-v[print version number and exit]' \
53     + '-u[use an alternate socket with lldpd]:UNIX socket:_files' \
54     + '-f[output format]:format:(plain xml json keyvalue)' \
55     + '*-c[read a configuration file]:configuration file:_files' \
56     + '(-)*::lldpcli command:__lldpcli_command'
57     +}
58     +
59     +
60     +_lldpcli "$@"
61     diff --git a/src/client/lldpcli.bash-completion b/src/client/lldpcli.bash-completion
62     new file mode 100755
63     index 0000000..8ce68d7
64     --- /dev/null
65     +++ b/src/client/lldpcli.bash-completion
66     @@ -0,0 +1,19 @@
67     +# -*- sh -*-
68     +_lldpcli()
69     +{
70     + COMPREPLY=()
71     + COMP_WORDBREAKS=" "
72     + local cur=${COMP_WORDS[COMP_CWORD]}
73     + local cmd=(${COMP_WORDS[*]})
74     +
75     + if [ "" != "$cur" ]; then
76     + unset cmd[COMP_CWORD]
77     + fi
78     +
79     + local choices=$(${cmd[0]} complete ${cmd[@]:1} | \
80     + cut -d " " -f 1)
81     + COMPREPLY=($(compgen -W '${choices}' -- ${cur} ))
82     + return 0
83     +}
84     +
85     +complete -F _lldpcli lldpcli

  ViewVC Help
Powered by ViewVC 1.1.20