Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
mysqlshow completion
- X-seq: zsh-workers 8835
- From: Johan Sundström <johsu650@xxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: mysqlshow completion
- Date: Wed, 1 Dec 1999 11:16:01 +0100 (MET)
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Hi!
I just swung together a rather convenient (old-style/compctl) completion
behaviour for mysqlshow; perhaps worth including in zsh completion archive
batch supplied with zsh:s?
function mysqlshow-completions ()
{
local args
setopt LOCAL_OPTIONS
unsetopt GLOB
read -c -A args
if [[ $args[-1] != '' ]];then
reply=($($args[0,-2] $args[-1]*|sed -n '4,${
/^| [^ ]/s/..\([^ ]*\).*$/\1/gp
}'))
else
reply=($($args|sed -n '4,${
/^| [^ ]/s/..\([^ ]*\).*$/\1/gp
}'))
fi
}
compctl -K mysqlshow-completions mysqlshow
It does completion on database, table and column names using the already
specified options on the command line.
/Johan Sundström
Messages sorted by:
Reverse Date,
Date,
Thread,
Author