File tree Expand file tree Collapse file tree 25 files changed +51
-54
lines changed Expand file tree Collapse file tree 25 files changed +51
-54
lines changed Original file line number Diff line number Diff line change @@ -820,7 +820,8 @@ _comp_delimited()
820
820
fi
821
821
done
822
822
done
823
- COMPREPLY=($( compgen -W ' "${COMPREPLY[@]}"' -- " ${cur##* " $delimiter " } " ) )
823
+ (( ${# COMPREPLY[@]} )) &&
824
+ COMPREPLY=($( compgen -W ' "${COMPREPLY[@]}"' -- " ${cur##* " $delimiter " } " ) )
824
825
fi
825
826
else
826
827
COMPREPLY=($( compgen " $@ " -- " ${cur##* " $delimiter " } " ) )
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ _ccze()
25
25
;;
26
26
--option | -${noargopts} o)
27
27
local -a opts=(scroll wordcolor lookups transparent cssfile)
28
- COMPREPLY=($( compgen -W ' ${opts[@]} ${opts[@]/#/no}' -- " $cur " ) )
28
+ COMPREPLY=($( compgen -W ' " ${opts[@]}" " ${opts[@]/#/no}" ' -- " $cur " ) )
29
29
return
30
30
;;
31
31
--plugin | -${noargopts} p)
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ _complete()
40
40
local -a opts=($( compgen -W ' $(_parse_usage help "-s $1")' -- " $cur " ) )
41
41
# -F, -C do not work the expected way with compgen
42
42
[[ $1 != * compgen ]] || opts=(" ${opts[@]// -[FC]/ } " )
43
- COMPREPLY=($( compgen -W ' ${opts[@]}' -- " $cur " ) )
43
+ COMPREPLY=($( compgen -W ' " ${opts[@]}" ' -- " $cur " ) )
44
44
else
45
45
COMPREPLY=($( compgen -A command -- " $cur " ) )
46
46
fi
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ _crontab()
36
36
done
37
37
38
38
if [[ $cur == -* ]]; then
39
- COMPREPLY=($( compgen -W ' ${!opts[@]}' -- " $cur " ) )
39
+ COMPREPLY=($( compgen -W ' " ${!opts[@]}" ' -- " $cur " ) )
40
40
return
41
41
fi
42
42
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ _curl()
113
113
# Looks like an option? Likely no --help category support
114
114
[[ $x != -* ]] || return
115
115
done
116
- COMPREPLY=($( compgen -W ' ${categories[@]}' -- " $cur " ) )
116
+ COMPREPLY=($( compgen -W ' " ${categories[@]}" ' -- " $cur " ) )
117
117
fi
118
118
return
119
119
;;
Original file line number Diff line number Diff line change @@ -41,7 +41,8 @@ _comp_xfunc_cvs_roots()
41
41
[[ -v CVSROOT ]] && cvsroots=(" $CVSROOT " )
42
42
[[ -r ~ /.cvspass ]] && cvsroots+=($( awk ' { print $2 }' ~ /.cvspass) )
43
43
[[ -r CVS/Root ]] && mapfile -tO ${# cvsroots[@]} cvsroots < CVS/Root
44
- COMPREPLY=($( compgen -W ' ${cvsroots[@]}' -- " $cur " ) )
44
+ (( ${# cvsroots[@]} )) &&
45
+ COMPREPLY=($( compgen -W ' "${cvsroots[@]}"' -- " $cur " ) )
45
46
__ltrim_colon_completions " $cur "
46
47
}
47
48
Original file line number Diff line number Diff line change @@ -139,9 +139,9 @@ _comp_cmd_dpkg_reconfigure()
139
139
--frontend | -${noargopts} f)
140
140
_comp_expand_glob opt ' /usr/share/perl5/Debconf/FrontEnd/*'
141
141
if (( ${# opt[@]} )) ; then
142
- opt=(${opt[@]##*/ } )
143
- opt=(${opt[@]% .pm} )
144
- COMPREPLY=($( compgen -W ' ${opt[@]}' -- " $cur " ) )
142
+ opt=(" ${opt[@]##*/ } " )
143
+ opt=(" ${opt[@]% .pm} " )
144
+ COMPREPLY=($( compgen -W ' " ${opt[@]}" ' -- " $cur " ) )
145
145
fi
146
146
return
147
147
;;
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ _hunspell()
16
16
dicts=(" ${dicts[@]##*/ } " )
17
17
dicts=(" ${dicts[@]% .dic} " )
18
18
local IFS=$' \n '
19
- COMPREPLY=($( compgen -W ' ${dicts[@]}' -- " $cur " ) )
19
+ COMPREPLY=($( compgen -W ' " ${dicts[@]}" ' -- " $cur " ) )
20
20
fi
21
21
return
22
22
;;
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ _ipmitool()
76
76
done
77
77
78
78
if ! " $has_cmd " ; then
79
- COMPREPLY=($( compgen -W ' ${cmds[@]}' -- " $cur " ) )
79
+ COMPREPLY=($( compgen -W ' " ${cmds[@]}" ' -- " $cur " ) )
80
80
return
81
81
fi
82
82
Original file line number Diff line number Diff line change 2
2
3
3
_lintian_tags ()
4
4
{
5
- local match search tags check_files
5
+ local search tags check_files
6
6
_comp_expand_glob check_files ' /usr/share/lintian/checks/*.desc'
7
7
(( ${# check_files[@]} )) || return 0
8
8
9
9
tags=$( awk ' /^Tag/ { print $2 }' " ${check_files[@]} " )
10
10
if [[ $cur == * , ]]; then
11
11
search=${cur// ,/ }
12
12
for item in $search ; do
13
- match=$( command grep -nE " ^Tag: $item $" \
14
- " ${check_files[@]} " | cut -d: -f1)
15
13
tags=$( command sed -e " s/\<$item \>//g" <<< " $tags" )
16
14
done
17
15
COMPREPLY+=($( compgen -W " $tags " ) )
@@ -50,7 +48,7 @@ _lintian_checks()
50
48
51
49
_lintian_infos ()
52
50
{
53
- local match search infos collection_files
51
+ local search infos collection_files
54
52
_comp_expand_glob collection_files ' /usr/share/lintian/collection/*.desc'
55
53
(( ${# collection_files[@]} )) || return 0
56
54
@@ -59,8 +57,6 @@ _lintian_infos()
59
57
if [[ $cur == * , ]]; then
60
58
search=${cur// ,/ }
61
59
for item in $search ; do
62
- match=$( command grep -nE " ^Collector: $item $" \
63
- " ${collection_files[@]} " | cut -d: -f1)
64
60
infos=$( command sed -e " s/\<$item \>//g" <<< " $infos" )
65
61
done
66
62
COMPREPLY+=($( compgen -W " $infos " ) )
You can’t perform that action at this time.
0 commit comments