about summary refs log tree commit diff
path: root/Completion/Unix/Command
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r--Completion/Unix/Command/.distfiles1
-rw-r--r--Completion/Unix/Command/_ant11
-rw-r--r--Completion/Unix/Command/_lsof44
-rw-r--r--Completion/Unix/Command/_mt78
-rw-r--r--Completion/Unix/Command/_rlogin101
-rw-r--r--Completion/Unix/Command/_ssh4
-rw-r--r--Completion/Unix/Command/_xsltproc23
7 files changed, 251 insertions, 11 deletions
diff --git a/Completion/Unix/Command/.distfiles b/Completion/Unix/Command/.distfiles
index e013f1aa2..0ba6f63db 100644
--- a/Completion/Unix/Command/.distfiles
+++ b/Completion/Unix/Command/.distfiles
@@ -18,4 +18,5 @@ _loadkeys     _apm          _ruby         _samba        _sysctl       _links
 _user_admin   _rsync        _arping	  _spamassassin _mtools	      _fsh
 _chkconfig    _cdcd         _irssi	  _sccs         _texinfo      _ant
 _global       _global_tags  _figlet       _ifconfig     _last         _larch
+_lsof         _mt           _xsltproc
 '
diff --git a/Completion/Unix/Command/_ant b/Completion/Unix/Command/_ant
index c1baf6f69..5edc6dd63 100644
--- a/Completion/Unix/Command/_ant
+++ b/Completion/Unix/Command/_ant
@@ -1,16 +1,9 @@
-#compdef ant -value-,ANT_ARGS,-default-
+#compdef ant
 
 typeset -A opt_args
 local state line curcontext="$curcontext"
 local target='*:target:->target'
 
-if [[ $service = *ANT_ARGS* ]]; then
-  compset -q
-  words=( fake "$words[@]" )
-  (( CURRENT++ ))
-  unset target
-fi
-
 _arguments -C \
   '-help[display usage information]' \
   '-projecthelp[print project hjelp information]' \
@@ -25,7 +18,7 @@ _arguments -C \
   '-listener[add an instance of class as a project listener]:classname:_java_class' \
   '(-f -file -buildfile)'{-f,-file,-buildfile}'[use specified build file]:build file:_files' \
   '*-D[specify property with value to use]:property' \
-  '-propertyfile[load properties from specfied file]:property file:_files' \
+  '-propertyfile[load properties from specified file]:property file:_files' \
   '-inputhandler[specify class which will handle input requests]:class:_java_class' \
   '-find[search for buildfile]:file:_files' \
   $target && return
diff --git a/Completion/Unix/Command/_lsof b/Completion/Unix/Command/_lsof
new file mode 100644
index 000000000..0e3bc7a1b
--- /dev/null
+++ b/Completion/Unix/Command/_lsof
@@ -0,0 +1,44 @@
+#compdef lsof
+
+_arguments -s -S \
+  '(-)'{-\?,-h}'[list help]' \
+  '-a[AND selections]' \
+  '-b[avoid kernel blocks]' \
+  '-C[disable reporting of path name components]' \
+  '-c[list files for command beginning with specified char]:char' \
+  '+d[search for open instances for contents of specified dir]:search directory:_files -/' \
+  '-d[specify list of file descriptors to exclude/include]:file descriptors' \
+  '+D[recursively search from specified dir]:search directory:_files -/' \
+  '-D[direct use of device cache file]:function:((\?\:report\ device\ cache\ file\ paths b\:build\ the\ device\ cache\ file i\:ignore\ the\ device\ cache\ file r\:read\ the\ device\ cache\ file u\:read\ and\ update\ the\ device\ cache\ file))' \
+  '-f[inhibit listing of kernel file structure info]::info type or path' \
+  '+f[enable listing of kernel file structure info]::info type' \
+  '-F[select output fields]:fields' \
+  '-g[select by process group id]::process group id' \
+  '*-i[select internet files]:address' \
+  '-k[specify kernel name list file]:kernel file:_files' \
+  '-l[inhibit conversion of UIDs to user names]' \
+  '-L[list no link counts]' \
+  '+L[list all link counts]::max link count for listed files' \
+  '-m[specify kernel memory file]:kernel memory file:_files' \
+  '-M[disable reporting of portmapper registrations]' \
+  '+M[enable reporting of portmapper registrations]' \
+  '-n[inhibit conversion of network numbers to hostnames]' \
+  '-N[select listing of NFS files]' \
+  '(-s)-o[list file offset]' \
+  '-O[avoid overheads of bypassing potential blocking]' \
+  '-P[inhibit conversion of port numbers to port names]' \
+  '-p[list files for specified processes]:processes:_pids' \
+  '-r[repeat listing endlessly]::delay (seconds)' \
+  '+r[repeat listing until no files listed]::delay (seconds)' \
+  '-R[list parent PID]' \
+  '(-o)-s[list file size]' \
+  '-S[specify timeout for kernel functions that might deadlock]:timeout (seconds)' \
+  '-T[select reporting of TCP/TPI info]::info type:((q\:queue\ length\ reporting s\:state\ reporting w\:window\ size\ reporting))' \
+  '(+w -w)-t[terse output]' \
+  '-u[list files owned by specified users]:user list:_users' \
+  '-U[list Unix domain socket files]' \
+  '(-)-v[list version info]' \
+  '-V[indicate unsuccessfully searched for items]' \
+  '(-t)+w[suppress warnings]' \
+  '(-t)-w[enable warnings]' \
+  '*:file:_files'
diff --git a/Completion/Unix/Command/_mt b/Completion/Unix/Command/_mt
new file mode 100644
index 000000000..8d2689539
--- /dev/null
+++ b/Completion/Unix/Command/_mt
@@ -0,0 +1,78 @@
+#compdef mt
+
+local -a args cmds
+local state line curcontext="$curcontext"
+
+args=( '(-)-f[specify raw tape device]:tape device:_files' )
+cmds=(
+  {eof,weof}':write specified number of EOF marks at current position'
+  'fsf:forward space by specified number of files'
+  'fsr:forward space by specified number of records'
+  'bsf:backward space by specified number of files'
+  'bsr:backward space by specified number of records'
+  'asf:absolute space to specified file number'
+  'eom:go to end of recorded media on the tape'
+  'rewind:rewind the tape'
+  {offline,rewoffl}':rewind and unload the tape'
+  'status:print status information about the tape unit'
+  'retension:rewind, wind to end of reel, rewind again - smoothes tape tension'
+  'erase:erase the tape'
+)
+
+if [[ $OSTYPE = linux* ]]; then
+  args=(
+    '(1 2 -)'{-V,--version}'[print version info]' 
+    '(1 2 -)--help[display usage info]'
+    '(-V --version --help -f --file)'{-f,--file=}'[specify raw tape device]:tape device:_files'
+    '(-V --version --help)--rsh-command=[specify remote shell command]:rsh command:_command_names -e'
+  )
+  # should really allow remote user@host for tape device
+  cmds=( $cmds
+    'bsfm:backward space by specified number of file marks'
+    'fsfm:forward space by specified number of file marks'
+    'fss:forward space by specified number of setmarks'
+    'bss:backward space by specified number of setmarks'
+    'wset:write specified number of setmarks at current position'
+    {eod,seod}':space to end of valid data'
+    'setblk:set drive block size'
+    'setdensity:set tape density code'
+    'drvbuffer:set drive buffer code'
+    'stoptions:set driver option bits'
+    'stwrthreshold:set device write threshold'
+    'seek:seek to specified block'
+    'tell:tell the current block on tape'
+    'densities:explain some common density codes'
+    'datcompression:enquire or set compression status'
+  )
+elif [[ $OSTYPE = freebsd* ]]; then
+  cmds=( ${cmds:#(asf|eof):*}
+    'smk:write specified number of setmarks at current position'
+    'fss:forward space by specified number of setmarks'
+    'bss:backward space by specified number of setmarks'
+    'rdhpos:read hardware block position'
+    'rdspos:read SCSI logical block position'
+    'sethpos:set hardware block position'
+    'setspos:set SCSI logical block position'
+    'errstat:print error status info about device'
+    'blocksize:set drive block size'
+    'density:set tape density code'
+    'geteotmodel:print the current EOT filemark model'
+    'seteotmodel:set the current EOT filemark model'
+    'eod:go to end of recorded media on the tape'
+    'comp:set compression mode'
+  )
+elif [[ $OSTYPE = solaris* ]]; then
+  cmds=( $cmds
+    'nbsf:back space by specified number of files positioning at file start'
+    'reserve:allow drive to remain reserved after close until explicit release'
+    'release:re-establish release at close behaviour'
+  )
+  if (( ! EUID )); then
+    cmds=( $cmds 'forcereserve:break reservation of tape drive held by other host' )
+  fi
+fi
+
+_arguments -C "$args[@]" '(--help --version -V)1:operation:->operation' \
+    '2:count:' && return
+
+[[ -n "$state" ]] && _describe -t operations 'operation' cmds
diff --git a/Completion/Unix/Command/_rlogin b/Completion/Unix/Command/_rlogin
new file mode 100644
index 000000000..522af7f4c
--- /dev/null
+++ b/Completion/Unix/Command/_rlogin
@@ -0,0 +1,101 @@
+#compdef rlogin rsh remsh=rsh rcp
+
+_rcp_remote_files () {
+  # There should be coloring based on all the different ls -F classifiers.
+  local expl remfiles remdispf remdispd suf ret=1
+
+  if zstyle -T ":completion:${curcontext}:" remote-access; then
+    remfiles=(${(M)${(f)"$(rsh ${words[CURRENT]%%:*} ls -d1F ${PREFIX%%[^./][^/]#}\* 2>/dev/null)"}%%[^/]#(|/)})
+    compset -P '*/'
+    compset -S '/*' || suf='remote file'
+
+    remdispf=(${remfiles:#*/})
+    remdispd=(${(M)remfiles:#*/})
+
+    _tags files
+    while _tags; do
+      while _next_label files expl ${suf:-remote directory}; do
+        [[ -n $suf ]] && compadd "$@" "$expl[@]" -d remdispf \
+	    ${remdispf%[*=@|]} && ret=0 
+	compadd ${suf:+-S/} "$@" "$expl[@]" -d remdispd \
+	    ${remdispd%/} && ret=0
+      done
+      (( ret )) || return 0
+    done
+  else
+    _message 'remote file'
+  fi
+}
+
+_rlogin () {
+  case "$service" in
+  rlogin)
+    _arguments -s \
+      '-8[allow 8-Bit data]' \
+      '-e-[specify escape character]:escape character:' \
+      '-l[specify login user name]:login as:_rlogin_users' \
+      ':remote host name:_rlogin_hosts'
+    ;;
+  rsh|remsh)
+    local context state line ret=1
+    typeset -A opt_args
+
+    _arguments -s \
+      '-n[ignore stdin]' \
+      '-l[specify login user name]:login as:_rlogin_users' \
+      ':remote host name:_rlogin_hosts' \
+      '(-):command: _command_names -e' \
+      '*::command:->command' && ret=0
+
+    if [[ -n "$state" ]]; then
+      shift 1 words
+      (( CURRENT-- ))
+      _normal && ret=0
+    fi
+    return ret
+    ;;
+  rcp)
+    local curcontext="$curcontext" state line ret=1 expl
+    typeset -A opt_args
+
+    _arguments -C -s \
+      '-p[preserve modification times]' \
+      '-r[recursively copy directories]' \
+      '*:files:->files' && ret=0
+
+    if [[ -n "$state" ]]; then
+      if compset -P '*:'; then
+	_rcp_remote_files && ret=0
+      elif compset -P '*@'; then
+        _wanted hosts expl host _rlogin_hosts -S: && ret=0
+      else
+        _alternative \
+	    'files:: _files' \
+	    'hosts:: _rlogin_all_hosts -S:' \
+	    'users:: _rlogin_users -qS@' && ret=0
+      fi
+    fi
+    return ret
+    ;;    
+  esac
+}
+
+_rlogin_users () {
+  _tags users && _combination -s '[:@]' my-accounts users-hosts users "$@"
+}
+
+_rlogin_hosts () {
+  _tags hosts &&
+      if [[ "$IPREFIX" == *@ ]]; then
+        _combination -s '[:@]' my-accounts users-hosts "users=${IPREFIX/@}" hosts "$@"
+      else
+        _combination -s '[:@]' my-accounts users-hosts \
+            ${opt_args[-l]:+"users=${opt_args[-l]:q}"} hosts "$@"
+      fi
+}
+
+_rlogin_all_hosts () {
+  _tags hosts && _combination -s '[:@]' my-accounts users-hosts hosts "$@"
+}
+
+_rlogin "$@"
diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh
index 9d56feae9..4c2eef7cc 100644
--- a/Completion/Unix/Command/_ssh
+++ b/Completion/Unix/Command/_ssh
@@ -70,8 +70,8 @@ _ssh () {
       '-V[show version number]' \
       '(-X)-x[disable X11 forwarding]' \
       '(-x)-X[enable X11 forwarding]' \
-      '-L[specify local port forwarding]:local port forwarding:->forward' \
-      '-R[specify remote port forwarding]:remote port forwarding:->forward' \
+      '*-L[specify local port forwarding]:local port forwarding:->forward' \
+      '*-R[specify remote port forwarding]:remote port forwarding:->forward' \
       ':remote host name:->userhost' \
       '*::args:->command' "$common[@]" && ret=0
     ;;
diff --git a/Completion/Unix/Command/_xsltproc b/Completion/Unix/Command/_xsltproc
new file mode 100644
index 000000000..ff83c735e
--- /dev/null
+++ b/Completion/Unix/Command/_xsltproc
@@ -0,0 +1,23 @@
+#compdef xsltproc
+
+_arguments \
+  '(-)'{--version,-V}'[show libxml and libxslt versions]' \
+  '(--verbose -v)'{--verbose,-v}"[show logs of what's happening]" \
+  '(--output -o)'{--output,-o}'[specify output file]:output file:_files' \
+  '--timing[display the time used]' \
+  '--repeat[run the transformation 20 times]' \
+  '--debug[dump the tree of the result instead]' \
+  '--dumpextensions[dump registered extension elements and functions]' \
+  '--novalid[skip the DTD loading phase]' \
+  '--noout[do not dump the result]' \
+  '--maxdepth[increase the maximum depth]:depth' \
+  '(--docbook)--html[input document is an HTML file]' \
+  '(--html)--docbook[input document is SGML docbook]' \
+  '--param[pass a parameter,value pair]:name::value (xpath expression)' \
+  '--stringparam[pass a parameter]:name::value' \
+  '--nonet[refuse to fetch DTDs or entities over network]' \
+  '--catalogs[use SGML catalogs]' \
+  '--xinclude[do XInclude processing on document input]' \
+  {--profile,--norman}'[dump profiling information]' \
+  '1:stylesheet:_files -g \*.xsl' \
+  ':file:_files -g \*.xml'