From: "Pete Hollobon" <pete@hollobon.com>
To: zsh-workers@sunsite.dk
Subject: Completion function for sqsh
Date: Thu, 12 Apr 2007 21:49:02 +0100 [thread overview]
Message-ID: <2ddaa6ea0704121349g7d25008dxb7c70ba05b9f85fe@mail.gmail.com> (raw)
Hi,
This is a completion function for sqsh (http://www.sqsh.org/), a nice
replacement for Sybase isql.
Pete
_sqsh
#compdef sqsh
_sybase_server() {
local interfaces
if [[ -n "$opt_args[-I]" ]]; then
interfaces=${(e)~opt_args[-I]:Q}
elif [[ -n "$opt_args[-y]" ]]; then
interfaces=${(e)~opt_args[-y]:Q}/interfaces
else
interfaces=$SYBASE/interfaces
fi
[[ -f $interfaces ]] && compadd ${${(f)"$(<$interfaces)"}:#[[:space:]#]*}
}
_arguments : \
'-A[Adjust TDS packet size (512)]:packet size (bytes):(512 1024
1536 2048)' \
'-B[Turn off file buffering on startup]' \
'-C[Send sql statment to server]:sql' \
'-D[Change database context on startup]:database' \
'-E[Replace default editor (vi)]:editor' \
'-H[Set the client hostname]:reported hostname' \
'-I[Alternate interfaces file]:interface file:_files' \
'-J[Client character set]:charset' \
'*-L[Set the value of a given variable]:variable=value' \
'-P[Sybase password (NULL)]:password' \
'-S[Name of Sybase server (\$DSQUERY)]:_sybase_server' \
'-U[Name of Sybase user]:username' \
'-X[Enable client password encryption]' \
'-a[Max. # of errors before abort]:number' \
'-b[Suppress banner message on startup]' \
'*-c[Alias for the ''go'' command]:go alias' \
'-d[Min. severity level to display]:severity level (0-22)' \
'-e[Echo batch prior to executing]' \
'-f[Min. severity level for failure]:failure severity' \
'-h[Disable headers and footers]' \
'-i[Read input from file]:_files' \
'-k[Specify alternate keywords file]:_files' \
'-l[Set debugging level]' \
'-m[Set display mode (normal)]:display style:(horiz vert bcp html
meta pretty none)' \
'-n[Set chained transaction mode]:chained transaction mode:(on off)' \
'-o[Direct all output to file]:_files' \
'-p[Display performance stats]' \
'-r[Specify name of .sqshrc]:_files' \
'-s[Alternate column separator (\t)]:column separator' \
'-t[Filter batches through program]:filter program:_files -g "*(*)"' \
'-v[Display current version and exit]' \
'-w[Adjust result display width]:number' \
'-y[Override value of $SYBASE]:_directories' \
'-z[Alternate display language]:language' \
reply other threads:[~2007-04-12 20:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2ddaa6ea0704121349g7d25008dxb7c70ba05b9f85fe@mail.gmail.com \
--to=pete@hollobon.com \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).