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: 1396175717.6f788576f1c9c2030d7c167aca52e32c66821396.radhermit@gentoo
1 commit: 6f788576f1c9c2030d7c167aca52e32c66821396
2 Author: Tim Harder <radhermit <AT> gentoo <DOT> org>
3 AuthorDate: Sun Mar 30 10:35:17 2014 +0000
4 Commit: Tim Harder <radhermit <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 30 10:35:17 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/zsh-completion.git;a=commit;h=6f788576
7
8 _eselect: use --brief option to simplify value parsing
9
10 ---
11 _eselect | 19 ++++++++++---------
12 1 file changed, 10 insertions(+), 9 deletions(-)
13
14 diff --git a/_eselect b/_eselect
15 index 5d75196..702bf4c 100644
16 --- a/_eselect
17 +++ b/_eselect
18 @@ -19,7 +19,7 @@ _eselect_env () {
19 _eselect_binutils () {
20 local binutilslist
21 if (( $words[(I)(set)] )); then
22 - binutilslist=(${${${(M)${(f)"$(eselect --color=no binutils list)"}## *}// \**/}//( \[*\] | \[*\] )/})
23 + binutilslist=(${(f)"$(eselect --brief --color=no binutils list)"})
24 _values "available binutils version" $binutilslist[@] && return 0
25 fi
26 _values "binutils options" $common_values \
27 @@ -31,7 +31,7 @@ _eselect_binutils () {
28 _eselect_kernel () {
29 local kernellist
30 if (( $words[(I)(set)] )); then
31 - kernellist=(${${${(M)${(f)"$(eselect --color=no kernel list)"}## *}// \**/}//( \[*\] | \[*\] )/})
32 + kernellist=(${(f)"$(eselect --brief --color=no kernel list)"})
33 _values "available kernel version" $kernellist[@] && return 0
34 fi
35 _values "kernel options" $common_values \
36 @@ -43,7 +43,7 @@ _eselect_kernel () {
37 _eselect_ctags () {
38 local ctagslist
39 if (( $words[(I)(set)] )); then
40 - ctagslist=(${${${(M)${(f)"$(eselect --color=no ctags list)"}## *}// \**/}//( \[*\] | \[*\] )/})
41 + ctagslist=(${(f)"$(eselect --brief --color=no ctags list)"})
42 _values "available ctags version" $ctagslist[@] && return 0
43 fi
44 _values "ctags options" $common_values \
45 @@ -56,7 +56,7 @@ _eselect_ctags () {
46 _eselect_profile () {
47 local profilelist
48 if (( $words[(I)(set)] )); then
49 - profilelist=(${${${(M)${(f)"$(eselect --color=no profile list)"}## *}// \**/}//( \[*\] | \[*\] )/})
50 + profilelist=(${(f)"$(eselect --brief --color=no profile list)"})
51 _values -w "available profiles" $profilelist[@] \
52 "--force[Forcibly set the symlink]" && return 0
53 fi
54 @@ -84,7 +84,7 @@ _eselect_fontconfig () {
55 _eselect_opengl () {
56 local opengllist
57 if (( $words[(I)(set)] )); then
58 - opengllist=(${${${(M)${(f)"$(eselect --color=no opengl list)"}## *}// \**/}//( \[*\] | \[*\] )/})
59 + opengllist=(${(f)"$(eselect --brief --color=no opengl list)"})
60 _values -w "opengl implementations and options" $opengllist[@] \
61 "--use-old[If an implementation is already set, use that one instead]" \
62 "--prefix[Set the source prefix]:path:_files -/" \
63 @@ -100,7 +100,7 @@ _eselect_opengl () {
64 _eselect_vi () {
65 local vilist
66 if (( $words[(I)(set)] )); then
67 - vilist=(${${${(M)${(f)"$(eselect --color=no vi list)"}## *}// \**/}//( \[*\] | \[*\] )/})
68 + vilist=(${(f)"$(eselect --brief --color=no vi list)"})
69 _values -w "vi implementation" $vilist[@] && return 0
70 elif (( $words[(I)(update)] )); then
71 _values -w "option" "--if-unset[Do not override existing implementation]" && return 0
72 @@ -116,10 +116,11 @@ _eselect () {
73 local globopts modnames modopts
74
75 globopts=(
76 + "--brief[Make output shorter]"
77 "--colour=no[Disable coloured output]"
78 "--color=no[Disable coloured output]"
79 )
80 - modnames=(${${${(M)${(f)"$(eselect --color=no modules list)"}## *}// */}// /})
81 + modnames=(${${${(M)${(f)"$(eselect --brief --color=no modules list)"}## *}// */}// /})
82
83 if ((CURRENT == 2)); then
84 _arguments -s \
85 @@ -133,7 +134,7 @@ _eselect () {
86 if [[ "$words[2]" == (env|binutils|kernel|ctags|profile|fontconfig|opengl|vi) ]]; then
87 _eselect_$words[2] "$@"
88 else
89 - modopts=(${${${(M)${(f)"$(eselect --color=no $words[2] usage)"}## *}// */}// /})
90 + modopts=(${${${(M)${(f)"$(eselect --brief --color=no $words[2] usage)"}## *}// */}// /})
91 _arguments -s \
92 "*:portage:_values 'eselect $words[2] options' \$modopts[@]" && return 0
93 fi
94 @@ -144,7 +145,7 @@ _eselect () {
95 if [[ "$words[3]" == (env|binutils|kernel|ctags|profile|fontconfig|opengl|vi) ]]; then
96 _eselect_$words[3] "$@"
97 else
98 - modopts=(${${${${(M)${(f)"$(eselect --color=no $words[3] usage)"}## *}// */}// /}// *})
99 + modopts=(${${${${(M)${(f)"$(eselect --brief --color=no $words[3] usage)"}## *}// */}// /}// *})
100 _arguments -s \
101 "*:portage:_values 'eselect $words[3] options' \$modopts[@]" && return 0
102 fi