Skip to content

Commit b88152e

Browse files
committed
fix(mysql): do not generate empty completion for charset
* Instead of replacing "Index.xml" with an empty string after the pathname expansions, we now exclude "Index.xml" from the pathname pattern. * In case that there is an empty filename as "/usr/share/mysql/charsets/.xml", we explicitly exclude empty charset names by specifying the option, -X '', for compgen.
1 parent 9dd2eab commit b88152e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

completions/mysql

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
_comp_xfunc_mysql_character_sets()
44
{
55
local -a charsets
6-
_comp_expand_glob charsets '/usr/share/m{ariadb,ysql}/charsets/*.xml'
6+
_comp_expand_glob charsets '/usr/share/m{ariadb,ysql}/charsets/!(Index).xml'
77
charsets+=(utf8)
88
charsets=("${charsets[@]##*/}")
9-
charsets=("${charsets[@]%%?(Index).xml}")
9+
charsets=("${charsets[@]%.xml}")
1010
local IFS=$'\n'
11-
COMPREPLY+=($(compgen -W '${charsets[@]}' -- "$cur"))
11+
COMPREPLY+=($(compgen -W '${charsets[@]}' -X '' -- "$cur"))
1212
}
1313

1414
_comp_deprecate_func _mysql_character_sets _comp_xfunc_mysql_character_sets

0 commit comments

Comments
 (0)