about summary refs log tree commit diff
path: root/Completion/Unix
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-04-13 09:18:11 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-04-13 09:18:11 +0000
commit69211ed83ac4c03b3c25f26b9ffca72d2f532bff (patch)
tree946b2818177d9e344d45a343c83708e89776bd91 /Completion/Unix
parentfc615adad738c1a7de77c90446fef49afac31302 (diff)
downloadzsh-69211ed83ac4c03b3c25f26b9ffca72d2f532bff.tar.gz
zsh-69211ed83ac4c03b3c25f26b9ffca72d2f532bff.tar.xz
zsh-69211ed83ac4c03b3c25f26b9ffca72d2f532bff.zip
23271: Pete Hollobon: completion for sqsh
Diffstat (limited to 'Completion/Unix')
-rw-r--r--Completion/Unix/Command/.distfiles1
-rw-r--r--Completion/Unix/Command/_sqsh53
2 files changed, 54 insertions, 0 deletions
diff --git a/Completion/Unix/Command/.distfiles b/Completion/Unix/Command/.distfiles
index 3448ff0fa..11d4127fe 100644
--- a/Completion/Unix/Command/.distfiles
+++ b/Completion/Unix/Command/.distfiles
@@ -35,6 +35,7 @@ _darcs          _ifconfig       _netcat         _sisu           _xmlsoft
 _date           _imagemagick    _nice           _slrn           _yafc
 _dd             _init_d         _nmap           _socket         _yodl
 _dhclient       _ip             _nslookup       _spamassassin   _yp
+                                                _sqsh
 _dict           _irssi          _pack           _ssh            _zcat
 _diff           _ispell         _patch          _strip          _zdump
 _diffstat       _java           _pax            _stty           _zip
diff --git a/Completion/Unix/Command/_sqsh b/Completion/Unix/Command/_sqsh
new file mode 100644
index 000000000..1e942b954
--- /dev/null
+++ b/Completion/Unix/Command/_sqsh
@@ -0,0 +1,53 @@
+#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' \