From 2a6547dd7c19b81b9bc532ae593308537d5133b0 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Mon, 12 Oct 2020 19:50:20 +0200 Subject: [PATCH] completions/mysql: Complete database name Gosh this interface is awful - we really really need to strip the weird ascii table and the "Database" header. [ci skip] --- share/completions/mysql.fish | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/completions/mysql.fish b/share/completions/mysql.fish index 2b8dea1bf..6d26f212d 100644 --- a/share/completions/mysql.fish +++ b/share/completions/mysql.fish @@ -13,7 +13,8 @@ complete -c mysql -s c -l comments -d 'Preserve comments in statements' complete -c mysql -l skip-comments -d 'Discard comments in statements' complete -c mysql -s C -l compress -d 'Compress all information' complete -c mysql -l connect-timeout -x -d 'Set the number of seconds before connection timeout' -complete -c mysql -s D -l database -x -d 'The database to use' +complete -c mysql -s D -l database -x -d 'The database to use' -a '(mysqlshow 2>/dev/null | tail -n +3 | string replace -rf \'\| *(\S*) *\|\' \'$1\')' +complete -c mysql -a '(mysqlshow 2>/dev/null | tail -n +3 | string replace -rf \'\| *(\S*) *\|\' \'$1\')' complete -c mysql -s \# -l debug -d 'Write a debugging log' complete -c mysql -l debug-check -d 'Print some debugging information' complete -c mysql -s T -l debug-info -d 'Prints debugging information and memory and CPU usage'