diff options
Diffstat (limited to 'bash/bashrc.d/mysql.bash')
-rw-r--r-- | bash/bashrc.d/mysql.bash | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/bash/bashrc.d/mysql.bash b/bash/bashrc.d/mysql.bash index d04b189d..24317b24 100644 --- a/bash/bashrc.d/mysql.bash +++ b/bash/bashrc.d/mysql.bash @@ -30,9 +30,8 @@ _mysql() { # Check directory exists and has at least one .cnf file local dir="$HOME"/.mysql if [[ ! -d $dir ]] || ( - declare -a files shopt -s nullglob dotglob - files=("$dir"/*.cnf) + declare -a files=("$dir"/*.cnf) ((! ${#files[@]})) ) ; then COMPREPLY=() @@ -40,8 +39,7 @@ _mysql() { fi # Return the names of the .cnf files sans prefix as completions - local -a items - items=("$dir"/*.cnf) + local -a items=("$dir"/*.cnf) items=("${items[@]##*/}") items=("${items[@]%%.cnf}") COMPREPLY=( $(compgen -W "${items[*]}" -- "$word") ) |