aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-12-02 12:24:36 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-12-02 12:42:25 +1300
commitcc7f884a0900456ab7eb9ee24d134ea47b615895 (patch)
tree63fb422d5a439ce96685f5f74288a68a60c699c8 /bash
parentd0edad20fb5efc2dfc493345e1e7419c39a5558f (diff)
downloaddotfiles-cc7f884a0900456ab7eb9ee24d134ea47b615895.tar.gz
dotfiles-cc7f884a0900456ab7eb9ee24d134ea47b615895.zip
Remove mysql(1) completion
It would be better to refactor this as just listing databases.
Diffstat (limited to 'bash')
-rw-r--r--bash/bash_completion.d/mysql.bash42
1 files changed, 0 insertions, 42 deletions
diff --git a/bash/bash_completion.d/mysql.bash b/bash/bash_completion.d/mysql.bash
deleted file mode 100644
index b6c3ce93..00000000
--- a/bash/bash_completion.d/mysql.bash
+++ /dev/null
@@ -1,42 +0,0 @@
-# Completion setup for MySQL for configured databases
-_mysql() {
-
- # Only makes sense for first argument
- ((COMP_CWORD == 1)) || return
-
- # Bail if directory doesn't exist
- local dirname
- dirname=$HOME/.mysql
- [[ -d $dirname ]] || return
-
- # Return the names of the .cnf files sans prefix as completions
- local db
- while IFS= read -rd '' db ; do
- [[ -n $db ]] || continue
- COMPREPLY[${#COMPREPLY[@]}]=$db
- done < <(
-
- # Set options so that globs expand correctly
- shopt -s dotglob nullglob
-
- # Make globbing case-insensitive if appropriate
- while read -r _ setting ; do
- case $setting in
- ('completion-ignore-case on')
- shopt -s nocaseglob
- break
- ;;
- esac
- done < <(bind -v)
-
- # Collect all the config file names, strip off leading path and .cnf
- local -a cnfs
- cnfs=("$dirname"/"$2"*.cnf)
- cnfs=("${cnfs[@]#"$dirname"/}")
- cnfs=("${cnfs[@]%.cnf}")
-
- # Print quoted entries, null-delimited
- printf '%q\0' "${cnfs[@]}"
- )
-}
-complete -F _mysql -o bashdefault -o default mysql