diff options
author | Oliver Kiddle <opk@users.sourceforge.net> | 2003-01-07 08:48:32 +0000 |
---|---|---|
committer | Oliver Kiddle <opk@users.sourceforge.net> | 2003-01-07 08:48:32 +0000 |
commit | 11207a7e48e1a2467a734706d2524c44f42843c4 (patch) | |
tree | 46b4602895214f445a51352af029e93ae6e6bc84 /Completion/Unix | |
parent | 99c9b50bb491e8e19774458e82bc9540f6d223f2 (diff) | |
download | zsh-11207a7e48e1a2467a734706d2524c44f42843c4.tar.gz zsh-11207a7e48e1a2467a734706d2524c44f42843c4.tar.xz zsh-11207a7e48e1a2467a734706d2524c44f42843c4.zip |
new completion functions for lsof, mt and xsltproc
Diffstat (limited to 'Completion/Unix')
-rw-r--r-- | Completion/Unix/Command/.distfiles | 2 | ||||
-rw-r--r-- | Completion/Unix/Command/_lsof | 44 | ||||
-rw-r--r-- | Completion/Unix/Command/_mt | 78 | ||||
-rw-r--r-- | Completion/Unix/Command/_xsltproc | 23 |
4 files changed, 146 insertions, 1 deletions
diff --git a/Completion/Unix/Command/.distfiles b/Completion/Unix/Command/.distfiles index a82d9e432..06296ec07 100644 --- a/Completion/Unix/Command/.distfiles +++ b/Completion/Unix/Command/.distfiles @@ -18,5 +18,5 @@ _last _loadkeys _ruby _sysctl _links _samba _user_admin _rsync _arping _spamassassin _mtools _ifconfig _fsh _chkconfig _cdcd _irssi _mysqldiff _sccs _netcat _larch _texinfo _figlet -_global _global_tags _ant +_global _global_tags _ant _lsof _mt _xsltproc ' 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..8296d1c8d --- /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 _pick_variant gnu=GNU unix --version; 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+=( + '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+=( + '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+=( '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/_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' |