Gentoo Archives: gentoo-commits

From: Tim Harder <radhermit@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/zsh-completion:master commit in: /
Date: Sun, 30 Mar 2014 11:00:31
Message-Id: 1396169081.e35d24bde64e76f326f9f46ea380c0f97db70ee9.radhermit@gentoo
1 commit: e35d24bde64e76f326f9f46ea380c0f97db70ee9
2 Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
3 AuthorDate: Sun Mar 30 08:44:41 2014 +0000
4 Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 30 08:44:41 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=e35d24bd
7
8 _eselect: don't duplicate common values
9
10 ---
11 _eselect | 49 ++++++++++++++++---------------------------------
12 1 file changed, 16 insertions(+), 33 deletions(-)
13
14 diff --git a/_eselect b/_eselect
15 index 9cc28a5..37a71a8 100644
16 --- a/_eselect
17 +++ b/_eselect
18 @@ -1,15 +1,19 @@
19 #compdef eselect
20 +
21 +common_values=(
22 + "help[Display help text]"
23 + "usage[Display usage information]"
24 + "version[Display version information]"
25 +)
26 +
27 _eselect_env () {
28 if (( $words[(I)(update)] )); then
29 _values "update options" \
30 "makelinks[force updating of links]" \
31 "noldconfig[Do not alter the ld.so cache or configuration]" && return 0
32 fi
33 - _values "env options" \
34 - "help[Display help text]" \
35 - "usage[Display usage information]" \
36 - "version[Display version information]" \
37 - 'update[Collect environment variables from all scripts]' && return 0
38 + _values "env options" $common_values \
39 + 'update[Collect environment variables from all scripts in /etc/env.d/]' && return 0
40 }
41
42 _eselect_binutils () {
43 @@ -18,10 +22,7 @@ _eselect_binutils () {
44 binutilslist=(${${${(M)${(f)"$(eselect --color=no binutils list)"}## *}// \**/}//( \[*\] | \[*\] )/})
45 _values "available binutils version" $binutilslist[@] && return 0
46 fi
47 - _values "binutils options" \
48 - "help[Display help text]" \
49 - "usage[Display usage information]" \
50 - "version[Display version information]" \
51 + _values "binutils options" $common_values \
52 "list[List all installed version of binutils]" \
53 "show[Print the currently active binutils version]" \
54 "set[Activate one of the installed binutils]" && return 0
55 @@ -33,10 +34,7 @@ _eselect_kernel () {
56 kernellist=(${${${(M)${(f)"$(eselect --color=no kernel list)"}## *}// \**/}//( \[*\] | \[*\] )/})
57 _values "available kernel version" $kernellist[@] && return 0
58 fi
59 - _values "kenrel options" \
60 - "help[Display help text]" \
61 - "usage[Display usage information]" \
62 - "version[Display version information]" \
63 + _values "kenrel options" $common_values \
64 "list[List available kernel symlink targets]" \
65 "show[Show the current kernel symlink]" \
66 "set[Set a new kernel symlink target]" && return 0
67 @@ -47,10 +45,7 @@ _eselect_ctags () {
68 ctagslist=(${${${(M)${(f)"$(eselect --color=no ctags list)"}## *}// \**/}//( \[*\] | \[*\] )/})
69 _values "available ctags version" $ctagslist[@] && return 0
70 fi
71 - _values "ctags options" \
72 - "help[Display help text]" \
73 - "usage[Display usage information]" \
74 - "version[Display version information]" \
75 + _values "ctags options" $common_values \
76 "list[List available ctags symlink targets]" \
77 "show[Show the current target of the ctags symlink]" \
78 "update[Automatically update the ctags symlink]" \
79 @@ -63,10 +58,7 @@ _eselect_profile () {
80 _values -w "available profiles" $profilelist[@] \
81 "--force[Forcibly set the symlink]" && return 0
82 fi
83 - _values "profile options" \
84 - "help[Display help text]" \
85 - "usage[Display usage information]" \
86 - "version[Display version information]" \
87 + _values "profile options" $common_values \
88 "list[List available profile symlink targets]" \
89 "show[Show the current make.profile symlink]" \
90 "set[Set a new profile symlink target]" && return 0
91 @@ -80,10 +72,7 @@ _eselect_fontconfig () {
92 fclistenabled=(${${${(M)${(M)${(f)"$(eselect --color=no fontconfig list)"}## *}#*\*}// \**/}//( \[*\] | \[*\] )/})
93 _values -w ".conf to disable" $fclistenabled[@] && return 0
94 fi
95 - _values "fontconfig options" \
96 - "help[Display help text]" \
97 - "usage[Display usage information]" \
98 - "version[Display version information]" \
99 + _values "fontconfig options" $common_values \
100 "list[List available fontconfig .conf files]" \
101 "disable[Disable specified fontconfig .conf file(s)]" \
102 "enable[Enable specified fontconfig .conf file(s)]" && return 0
103 @@ -98,10 +87,7 @@ _eselect_opengl () {
104 "--dst-prefix[Set the destination prefix]:path:_files -/" \
105 "--impl-headers[Override global headers with ones provided by this profile]" && return 0
106 fi
107 - _values "opengl options" \
108 - "help[Display help text]" \
109 - "usage[Display usage information]" \
110 - "version[Display version information]" \
111 + _values "opengl options" $common_values \
112 "list[List the available OpenGL implementations]" \
113 "set[Select the OpenGL implementation]" \
114 "show[Print the current OpenGL implementation]" && return 0
115 @@ -114,10 +100,7 @@ _eselect_vi () {
116 elif (( $words[(I)(update)] )); then
117 _values -w "option" "--if-unset[Do not override existing implementation]" && return 0
118 fi
119 - _values "vi options" \
120 - "help[Display help text]" \
121 - "usage[Display usage information]" \
122 - "version[Display version information]" \
123 + _values "vi options" $common_values \
124 "list[List available vi implementations]" \
125 "set[Set a new vi implementation provider]" \
126 "show[Show the current vi implementation]" \