Skip to content

Commit

Permalink
mysql: Fix --default-character-set completion with mariadb
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Feb 25, 2016
1 parent f8b0828 commit 695b28a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions completions/mysql
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ _mysql()
return 0
;;
--default-character-set)
[[ -d /usr/share/mysql/charsets ]] && \
COMPREPLY=( $( compgen -W "$(command ls /usr/share/mysql/charsets | command sed -e '/^README$/d' -e '/^Index\.xml$/d' -e 's/.xml$//') utf8" -- "$cur" ) )
local charsets=( $( command ls /usr/share/m{ariadb,ysql}/charsets/*.xml 2>/dev/null ) )
charsets=( ${charsets[@]##*/} )
charsets=( ${charsets[@]%%?(Index).xml} utf8 )
COMPREPLY=( $( compgen -W '${charsets[@]}' -- "$cur" ) )
return 0
;;

Expand Down
2 changes: 2 additions & 0 deletions test/lib/completions/mysql.exp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ setup


assert_complete_any "mysql --"
sync_after_int


assert_complete_any "mysql --default-character-set="
sync_after_int


Expand Down

0 comments on commit 695b28a

Please sign in to comment.