zsh-workers
 help / color / mirror / code / Atom feed
* mysqlshow completion
@ 1999-12-01 10:16 Johan Sundström
  0 siblings, 0 replies; only message in thread
From: Johan Sundström @ 1999-12-01 10:16 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-12-01 10:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-01 10:16 mysqlshow completion Johan Sundström

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).