* PATCH: completion updates
@ 2004-02-13 15:25 Oliver Kiddle
0 siblings, 0 replies; 2+ messages in thread
From: Oliver Kiddle @ 2004-02-13 15:25 UTC (permalink / raw)
To: Zsh workers
A few updates:
_modutils - now finds modules on 2.6. Some options have changed
for 2.6 too but I've haven't touched those
_lzop - uses braces where descriptions are identical
_perldoc - complete all options
_vorbis - update for latest version (complete .flac files)
_mozilla - firebird has been renamed again
_nedit - update for new options in NEdit 5.4
Oliver
Index: Completion/Linux/Command/_modutils
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Linux/Command/_modutils,v
retrieving revision 1.3
diff -u -r1.3 _modutils
--- Completion/Linux/Command/_modutils 25 Jun 2003 09:03:06 -0000 1.3
+++ Completion/Linux/Command/_modutils 13 Feb 2004 15:14:03 -0000
@@ -67,8 +67,8 @@
;;
all_modules)
- modules=( ${${(M)${(f)"$(_call_program modules ${(M)words[1]##*/}modprobe -c 2>/dev/null)"}:#path*}#*[=]} )
- _wanted modules expl module compadd ${^modules}/**/*.o(:t:r) && return
+ modules=( ${${${${(f)"$(_call_program modules ${(M)words[1]##*/}modprobe -l 2>/dev/null)"}:#}##*/}%.*} )
+ _wanted modules expl module compadd -a modules && return
;;
params)
Index: Completion/Unix/Command/_lzop
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_lzop,v
retrieving revision 1.4
diff -u -r1.4 _lzop
--- Completion/Unix/Command/_lzop 21 Jan 2004 13:53:29 -0000 1.4
+++ Completion/Unix/Command/_lzop 13 Feb 2004 15:14:03 -0000
@@ -4,42 +4,23 @@
typeset -A opt_args
_arguments -C -s \
- '(--to-stdout --stdout)-c[write on standard output]' \
- '(-c --stdout)--to-stdout[write on standard output]' \
- '(-c --to-stdout)--stdout[write on standard output]' \
- '(--decompress --uncompress -x -extract)-d[decompress]' \
- '(-d --uncompress -x -extract)--decompress[decompress]' \
- '(-d --decompress -x -extract)--uncompress[decompress]' \
- '(--extract -d --decompress --uncompress -n --name -p --path)-x[extract]' \
- '(-x -d --decompress --uncompress -n --name -p --path)-x[extract]' \
- '(--force)-f[force overwrite]' \
- '(-f)--force[force overwrite]' \
- '(--help -H)-h[display help message]' \
- '(-h -H)--help[display help message]' \
- '(-h --help)-H[display help message]' \
- '(--list)-l[list compressed file contents]' \
- '(-l)--list[list compressed file contents]' \
- '(--license)-L[display software license]' \
- '(-L)--license[display software license]' \
- '(--no-name -N --name)-n[do not save or restore the original name and time stamp]' \
- '(-n -N --name)--no-name[do not save or restore the original name and time stamp]' \
- '(--name -n --no-name)-N[save or restore the original name and time stamp]' \
- '(-N -n --no-name)--name[save or restore the original name and time stamp]' \
+ '(-c --stdout --to-stdout)'{-c,--stdout,--to-stdout}'[write on standard output]' \
+ '(-d --decompress --uncompress -x -extract)'{-d,--decompress,--uncompress}'[decompress]' \
+ '(-x --extract -d --decompress --uncompress -n --name -p --path)'{-x,--extract}'[extract]' \
+ '(-f --force)'{-f,--force}'[force overwrite]' \
+ '(- *)'{-h,-H,--help}'[display help information]' \
+ '(-l --list)'{-l,--list}'[list compressed file contents]' \
+ '(-L --license)'{-L,--license}'[display software license]' \
+ '(-n --no-name -N --name)'{-n,--no-name}'[do not save or restore the original name and time stamp]' \
+ '(-N --name -n --no-name)'{-N,--name}'[save or restore the original name and time stamp]' \
'--no-mode[do not restore original mode]' \
'--no-time[do not restore original time stamp]' \
- '(--quiet --silent)-q[suppress all warnings]' \
- '(-q --silent)--quiet[suppress all warnings]' \
- '(-q --quiet)--silent[suppress all warnings]' \
- '(--recursive)-r[operate recursively on directories]' \
- '(-r)--recursive[operate recursively on directories]' \
- '(--suffix)-S+[specify suffix for compressed files]:suffix:' \
- '(-S)--suffix=[specify suffix for compressed files]:suffix:' \
- '(--test)-t[test compressed file integrity]' \
- '(-t)--test[test compressed file integrity]' \
- '*-v[verbose mode]' \
- '*--verbose[verbose mode]' \
- '(--version)-V[display version number]' \
- '(-V)--version[display version number]' \
+ '(-q --quiet --silent)'{-q,--quiet,--silent}'[suppress all warnings]' \
+ '(-r --recursive)'{-r,--recursive}'[operate recursively on directories]' \
+ '(-S --suffix)'{-S+,--suffix=}'[specify suffix for compressed files]:suffix' \
+ '(-t --test)'{-t,--test}'[test compressed file integrity]' \
+ \*{-v,--verbose}'[verbose mode]' \
+ '(- *)'{-V,--version}'[display version number]' \
'( -1 -2 -3 -4 -5 -6 -7 -8 -9 --best)--fast' \
'(--fast -2 -3 -4 -5 -6 -7 -8 -9 --best)-1' \
'(--fast -1 -3 -4 -5 -6 -7 -8 -9 --best)-2' \
@@ -53,19 +34,12 @@
'(--fast -1 -2 -3 -4 -5 -6 -7 -8 -9 )--best' \
'--ls=[list each compressed file in a format similar to ls -ln]:ls flag:->flags' \
'--info[list internal header fields for each compressed file]' \
- '(--sysinfo)-I[display information about the system]' \
- '(-I)--sysinfo[display information about the system]' \
- '(--outfile)-o[specify output file]:output file:_files' \
- '(-o)--outfile=[specify output file]:output file:_files' \
- '(--path)-p[write output files to specified directory]:directory:_files -/' \
- '(-p)--path=[write output files to specified directory]:directory:_files -/' \
- '(--no-checksum)-F[do not store or verify a checksum]' \
- '(-F)--no-checksum[do not store or verify a checksum]' \
- "(--keep -U --unlink --delete)-k[keep (don't delete) input files]" \
- "(-k -U --unlink --delete)--keep[keep (don't delete) input files]" \
- '(--unlink --delete)-U[delete input files]' \
- '(-U --delete)--unlink[delete input files]' \
- '(-U --unlink)--delete[delete input files]' \
+ '(-I --sysinfo)'{-I,--sysinfo}'[display information about the system]' \
+ '(-o --outfile)'{-o,--outfile=}'[specify output file]:output file:_files' \
+ '(-p --path)'{-p,--path=}'[write output files to specified directory]:directory:_files -/' \
+ '(-F --no-checksum)'{-F,--no-checksum}'[do not store or verify a checksum]' \
+ '(-k --keep -U --unlink --delete)'{-k,--keep}"[keep (don't delete) input files]" \
+ '(-U --unlink --delete)'{-U,--unlink,--delete}'[delete input files]' \
'--no-stdin[do not try to read stdin]' \
'--no-warn[suppress all warnings]' \
'--ignore-warn[suppress all warnings and never exit with status 2]' \
@@ -86,15 +60,14 @@
_files "$expl[@]" -g '*.[tl]zo(-.)' && ret=0
else
_description files expl 'file to compress'
- _files "$expl[@]" -g '*~*.[tl]zo(-.)' && ret=0
-
+ _files "$expl[@]" -g '^*.[tl]zo(-.)' && ret=0
fi
;;
flags)
zstyle -s ":completion:${curcontext}:flags" list-separator sep || sep=--
- disp=( \
- "F $sep Append a \`*' for executable files" \
- "G $sep Inhibit display of group information" \
+ disp=(
+ "F $sep Append a \`*' for executable files"
+ "G $sep Inhibit display of group information"
"Q $sep Enclose file names in double quotes" )
disp=( ${disp[@]:#[Z$PREFIX]*} )
compset -P '[FGQ]*'
Index: Completion/Unix/Command/_perldoc
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_perldoc,v
retrieving revision 1.2
diff -u -r1.2 _perldoc
--- Completion/Unix/Command/_perldoc 21 Jan 2004 13:53:29 -0000 1.2
+++ Completion/Unix/Command/_perldoc 13 Feb 2004 15:14:03 -0000
@@ -1,23 +1,59 @@
-#compdef perldoc
-#
-# _perldoc - zsh completion function for perldoc
-#
-# Adam Spiers <adam@spiers.net>
-#
-
-_perldoc () {
- _arguments -s \
- '-h:help:' \
- '(-q)-f:Perl built-in function:_perl_builtin_funcs:*:' \
- '(-f)-q:Perl FAQ keyword:' \
- '*:Perl pod pages:_perl_pods'
-}
-
-_perl_pods () {
- _alternative \
- 'modules:: _perl_modules' \
- 'pods:: _perl_basepods' \
- 'files:Perl modules and .pods:_files -g "*.(pod|pm)(-.)"'
-}
+#compdef perldoc -value-,PERLDOC,-default-
-_perldoc "$@"
+local curcontext="$curcontext" state line expl args ret=1
+typeset -A opt_args
+
+args=( '*:Perl pod pages:->perl-pods' )
+
+if [[ $service = *PERLDOC* ]]; then
+ compset -q
+ words=( fake "$words[@]" )
+ (( CURRENT++ ))
+ args=()
+fi
+
+_arguments -C -s -S -A "-*" \
+ '(- *)-h[print help information]' \
+ '(- *)-V[display version information]' \
+ '-v[verbose output]' \
+ '-t[use plain text output instead of nroff]' \
+ '-u[show raw Pod source]' \
+ '*-m[display entire module]:module:_perl_modules' \
+ '-l[display only filename of the module found]' \
+ '-F[consider arguments as filenames]' \
+ '(-q)-f+[view documentation for Perl built-in function]:perl builtin function:->perl-builtin-funcs' \
+ '(-f)-q+[search question headings in Perl FAQ]:regular expression' \
+ '(-d)-T[send output direct to stdout and not via pager]' \
+ '(-T)-d+[specify output file]:output file:_files' \
+ '-o+[specify output format]:output format:(man nroff pod rtf text tk xml latex)' \
+ '-M[specifies module to use for formatting]:module:_perl_modules' \
+ '-w[specify option to formatter]:option' \
+ '-X[use an index if present]' \
+ '-n+[specify replacement for nroff]:nroff replacement:_command_names -e' \
+ '-r[recursive search]' \
+ '-i[ignore case]' \
+ "$args[@]" && ret=0
+
+case $state in
+ perl-builtin-funcs)
+ : ${(A)_perl_builtin_funcs:=${(u)${${(M)${(f)"$(_call_program functions \
+ perldoc -u perlfunc 2>/dev/null)"}:#\=item [a-z]*}#* }%%[^a-z]*}}
+
+ _wanted functions expl 'perl built-in function' compadd "$@" -a - \
+ _perl_builtin_funcs && ret=0
+ ;;
+
+ perl-pods)
+ if (( $+opt_args[-F] )); then
+ _wanted files expl 'Perl modules and .pods' \
+ _files -g "*.(pod|pm)(-.)" && ret=0
+ else
+ _alternative \
+ 'modules:: _perl_modules' \
+ 'pods:: _perl_basepods' \
+ 'files:Perl modules and .pods:_files -g "*.(pod|pm)(-.)"' && ret=0
+ fi
+ ;;
+esac
+
+return ret
Index: Completion/Unix/Command/_vorbis
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_vorbis,v
retrieving revision 1.3
diff -u -r1.3 _vorbis
--- Completion/Unix/Command/_vorbis 21 Jan 2004 13:53:29 -0000 1.3
+++ Completion/Unix/Command/_vorbis 13 Feb 2004 15:14:03 -0000
@@ -5,8 +5,9 @@
case $service in
oggenc)
_arguments -s \
- '(-)'{-h,--help}'[show help]' \
- '(-r --raw)'{-r,--raw}'[assume input data is raw little-endian audio data with no header information]' \
+ '(- *)'{-h,--help}'[show help]' \
+ '(- *)'{-v,--version}'[display version information]' \
+ '(-r --raw)'{-r,--raw}'[assume input data is raw, little-endian with no header information]' \
'(-B --raw-bits)'{-B,--raw-bits=}'[set raw mode input sample size in bits]:sample size:(8 16)' \
'(-C --raw-chan)'{-C,--raw-chan=}'[set raw mode input number of channels]:number of channels' \
'(-R --raw-rate)'{-R,--raw-rate=}'[set raw mode input sample rate]:sample rate:(44100 48000)' \
@@ -21,8 +22,11 @@
'--downmix[down mix input from stereo to mono]' \
'--advanced-encode-option:option name:_values option "bitrate_average_window[set the managed bitrate window]\:number (seconds)" "lowpass_frequency[set the lowpass frequency]\:frequency (kHz)"' \
'(-s --serial)'{-s,--serial}'[force a specific serial number in the output stream]' \
- '(-o --output-file)'{-o,--output-file=}'[write the Ogg Vorbis stream to output_file]:files:->oggfiles' \
- '(-n --pattern)'{-n,--pattern=}'[specify pattern for producing filenames]:string' \
+ "--discard-comments[don't copy comments from FLAC file to output Ogg Vorbis file]" \
+ '(-o --output)'{-o,--output=}'[write the Ogg Vorbis stream to output_file]:files:->oggfiles' \
+ '(-n --names)'{-n,--names=}'[specify pattern for producing filenames]:string' \
+ '(-X --name-remove)'{-X,--name-remove=}'[remove specified characters from output filenames]:characters' \
+ '(-P --name-replace)'{-P,--name-replace=}'[specify replacement characters for those removed]:characters' \
'(-c --comment)'{-c,--comment}'[add the string comment as an extra comment]:comment' \
'(-a --artist)'{-a,--artist}'[set the artist comment field in the comments to artist]:artist' \
'(-G --genre)'{-G,--genre}'[set the genre comment field in the comments to genre]:genre' \
@@ -30,62 +34,57 @@
'(-N --tracknum)'{-N,--tracknum}'[set the track number comment field to the given value]:track number' \
'(-t --title)'{-t,--title}'[set the track title comment field to title]:title' \
'(-l --album)'{-l,--album}'[set the album comment field to album]' \
- '*:wav file:_files -g "(#i)*.wav(-.)"' && ret=0
+ '*:input file:_files -g "(#i)*.(flac|wav|aiff)(-.)"' && ret=0
;;
ogg123)
_arguments -C -s \
- '(-h --help)'{-h,--help}'[show help]' \
- '(-)'{-V,--version}'[display version information]' \
- '(-d --device)'{-d,--device}'[output device]:device:((null\:discard\ all\ data oss\:open\ sound\ system sun\:sun\ audio alsa\:advanced\ linux\ sound\ architecture irix\:IRIX\ audio arts\:aRts\ sound\ daemon esd\:enlightened\ sound\ daemon au\:sun\ audio\ file raw\:raw\ sample wav\:wav\ file))' \
- '(-f --files)'{-f,--files=}'[output filename for a previously specified file device]:output filename:_files' \
- '(-k --skip)'{-k,--skip}'[skip the first '\''n'\'' seconds]:seconds' \
+ '(- *)'{-h,--help}'[show help]' \
+ '(- *)'{-V,--version}'[display version information]' \
+ \*{-d,--device}'[output device]:device:((null\:discard\ all\ data oss\:open\ sound\ system sun\:sun\ audio alsa\:advanced\ linux\ sound\ architecture irix\:IRIX\ audio arts\:aRts\ sound\ daemon esd\:enlightened\ sound\ daemon au\:sun\ audio\ file raw\:raw\ sample wav\:wav\ file))' \
+ \*{-f,--files=}'[output filename for a previously specified file device]:output filename:_files -g "(#i)*.(wav|au|raw)(-.)"' \
+ '(-k --skip)'{-k,--skip}"[skip the first 'n' seconds (or to hh:mm:ss)]:seconds" \
+ '(-K --end)'{-K,--end}"[end at 'n' seconds (or hh:mm:ss)]:seconds" \
'(-b --buffer)'{-b,--buffer}'[size of input buffer]:kilobytes' \
'(-p --prebuffer)'{-p,--prebuffer}'[prebuffer percentage]:percent' \
- '(-q --quiet)'{*-v,*--verbose}'[increase verbosity]' \
+ '(-q --quiet)*'{-v,--verbose}'[increase verbosity]' \
'(-q --quiet -v --verbose)'{--quiet,-q}'[quiet mode]' \
'(-x --nth)'{-x,--nth}'[block decode intervall]:number' \
'(-y --ntimes)'{-y,--ntimes}'[block repeat count]:number' \
'(-z --shuffle)'{-z,--shuffle}'[shuffle play]' \
- '(-l --delay)'{-l,--delay=}'[set delay]:delay (ms)' \
- '(-@ --playlist)'{-@,--playlist}'[play all of the files from a playlist]:playlist:_files' \
+ '(-l --delay)'{-l,--delay=}'[set delay between two SIGINTs to quit]:delay (ms)' \
+ '(-@ --list)'{-@,--list}'[play all of the files from a playlist]:playlist:_files' \
'--audio-buffer[size of output audio buffer]:kilobytes' \
- {'*-o','*--device-option='}'[assign device option values]:device option:->devopts' \
- '*:files:->oggfiles' && ret=0
+ \*{-o,--device-option=}'[assign device option values]:device option:->devopts' \
+ '*:sound file or directory:_files -g "(#i)*.(ogg|flac)"' && ret=0
;;
ogginfo)
- _arguments -C -s \
- '-h[show a help and usage message]' \
- '*-q[quiet mode]' \
- '-v[verbose mode]' \
- '*:files:->oggfiles' && ret=0
+ _arguments \
+ '(- *)-h[show a help and usage message]' \
+ '(-)*-q[quiet mode]' \
+ '(-)-v[verbose mode]' \
+ '*:ogg vorbis file:_files -g "(#i)*.ogg(-.)"' && ret=0
;;
oggdec)
- _arguments -C -s \
+ _arguments -s \
'(-q --quiet)'{-q,--quiet}'[quiet mode]' \
- '(-)'{-h,--help}'[print help information]' \
- '(-)'{-v,--version}'[display version information]' \
+ '(- *)'{-h,--help}'[print help information]' \
+ '(- *)'{-v,--version}'[display version information]' \
'(-b --bits)'{-b,--bits=}'[bits per sample]:bits per sample:(8 16)' \
'(-e --endian)'{-e,--endian=}'[set endianness for 16-bit output]:endianness:((0\:\(default\)\ little-endian\ \(Intel\ byte\ order\) 1\:big-endian\ \(sane\ byte\ order\)))' \
'(-R --raw)'{-R,--raw=}'[output in raw format]' \
'(-o --output)'{-o,--output=}'[write output to specified filename]:output filename:_files' \
'(-s --sign)'{-s,--sign=}'[set signedness for output]:signedness:((0\:unsigned 1\:signed\ \(default\)))' \
- '*:files:->oggfiles' && ret=0
+ '*:ogg vorbis file:_files -g "(#i)*.ogg(-.)"' && ret=0
;;
esac
-case $state in
- oggfiles)
- _wanted files expl 'ogg vorbis file' \
- _files "$expl[@]" -g '(#i)*.ogg(-.)' && return
- ;;
- devopts)
- if compset -p '*:'; then
- _message -e value value
- else
- _wanted devopts expl 'device option' \
- compadd -S : - dsp dev card buf_size host byteorder && return
- fi
- ;;
-esac
+if [[ $state = devopts ]]; then
+ if compset -p '*:'; then
+ _message -e value value
+ else
+ _wanted devopts expl 'device option' \
+ compadd -S : - dsp dev card buf_size host byteorder && return
+ fi
+fi
return ret
Index: Completion/X/Command/_mozilla
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/X/Command/_mozilla,v
retrieving revision 1.3
diff -u -r1.3 _mozilla
--- Completion/X/Command/_mozilla 21 Nov 2003 20:29:52 -0000 1.3
+++ Completion/X/Command/_mozilla 13 Feb 2004 15:14:03 -0000
@@ -1,4 +1,4 @@
-#compdef mozilla mozilla-firebird mozilla-xremote-client
+#compdef mozilla mozilla-firefox mozilla-xremote-client
local curcontext="$curcontext" state line ret=1 suf
typeset -A opt_args
Index: Completion/X/Command/_nedit
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/X/Command/_nedit,v
retrieving revision 1.3
diff -u -r1.3 _nedit
--- Completion/X/Command/_nedit 19 Aug 2002 14:51:59 -0000 1.3
+++ Completion/X/Command/_nedit 13 Feb 2004 15:14:03 -0000
@@ -10,20 +10,22 @@
'-do[execute macro or action commands]:macro command'
'-lm[specify language mode]:language mode:->lang'
'-svrname[name the server]:nedit server name'
- '(-noiconic)-iconic[set initial window state to iconic]'
+ '(-noiconic -icon -iconic)'{-icon,-iconic}'[set initial window state to iconic]'
'(- *)'{-V,-version}'[display version information]'
'*-xrm:resource:_x_resource'
'*:file:_files'
)
if [[ $service = nc ]]; then
- _x_arguments -C \
+ _x_arguments -C -S \
'(-noask)-ask[prompt if no server found]' \
'(-ask)-noask[start a new server without asking if none found]' \
+ "-wait[don't return to the shell until all files given are closed]" \
+ '-timeout[timeout period when talking to server]:timeout (seconds)' \
'-svrcmd[command to run server]:server command:_command_names -e' \
"$nedit_common[@]" && ret=0
else
- _x_arguments -C \
+ _x_arguments -C -S \
'-server[designate this session as an nedit server]' \
'-tags[load ctags file]:tags file:_files' \
'-tabs[specify tab width in characters]:tab width' \
^ permalink raw reply [flat|nested] 2+ messages in thread
* PATCH: completion updates
@ 2003-01-06 18:03 Oliver Kiddle
0 siblings, 0 replies; 2+ messages in thread
From: Oliver Kiddle @ 2003-01-06 18:03 UTC (permalink / raw)
To: Zsh workers
Just a clear out of some of the completion function updates I have.
Patch contains new completions for lsof, mt and xsltproc. A spelling
correction in _ant, _ssh should allow for multiple port forwardings and
I copied the remote file part of _scp over for _rcp.
Oliver
Index: Completion/Unix/Command/.distfiles
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/.distfiles,v
retrieving revision 1.29
diff -u -r1.29 .distfiles
--- Completion/Unix/Command/.distfiles 3 Sep 2002 12:32:59 -0000 1.29
+++ Completion/Unix/Command/.distfiles 6 Jan 2003 17:45:16 -0000
@@ -18,5 +18,5 @@
_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
'
Index: Completion/Unix/Command/_ant
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_ant,v
retrieving revision 1.3
diff -u -r1.3 _ant
--- Completion/Unix/Command/_ant 24 Aug 2002 19:19:14 -0000 1.3
+++ Completion/Unix/Command/_ant 6 Jan 2003 17:45:16 -0000
@@ -27,7 +27,7 @@
'*-listener[add an instance of class as a project listener]:classname:_java_class -cp ${(j.:.)c}' \
'(-f -file -buildfile -find)'{-f,-file,-buildfile}'[use specified build file]:build file:_files' \
'*-D[specify property with value to use]:property:->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 -cp ${(j.\:.)c}' \
'(-f -file -buildfile)-find[search for build file towards the root of filesystem]:build file:(build.xml)' \
$target && return
Index: Completion/Unix/Command/_lsof
===================================================================
RCS file: Completion/Unix/Command/_lsof
diff -N Completion/Unix/Command/_lsof
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Completion/Unix/Command/_lsof 6 Jan 2003 17:45:16 -0000
@@ -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'
Index: Completion/Unix/Command/_mt
===================================================================
RCS file: Completion/Unix/Command/_mt
diff -N Completion/Unix/Command/_mt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Completion/Unix/Command/_mt 6 Jan 2003 17:45:16 -0000
@@ -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
Index: Completion/Unix/Command/_rlogin
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_rlogin,v
retrieving revision 1.1
diff -u -r1.1 _rlogin
--- Completion/Unix/Command/_rlogin 2 Apr 2001 12:01:21 -0000 1.1
+++ Completion/Unix/Command/_rlogin 6 Jan 2003 17:45:16 -0000
@@ -1,5 +1,32 @@
#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 -e remote-files 'remote file'
+ fi
+}
+
_rlogin () {
case "$service" in
rlogin)
@@ -38,7 +65,7 @@
if [[ -n "$state" ]]; then
if compset -P '*:'; then
- _files && ret=0
+ _rcp_remote_files && ret=0
elif compset -P '*@'; then
_wanted hosts expl host _rlogin_hosts -S: && ret=0
else
Index: Completion/Unix/Command/_ssh
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_ssh,v
retrieving revision 1.17
diff -u -r1.17 _ssh
--- Completion/Unix/Command/_ssh 6 Sep 2002 06:19:57 -0000 1.17
+++ Completion/Unix/Command/_ssh 6 Jan 2003 17:45:16 -0000
@@ -70,8 +70,8 @@
'-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
;;
Index: Completion/Unix/Command/_xsltproc
===================================================================
RCS file: Completion/Unix/Command/_xsltproc
diff -N Completion/Unix/Command/_xsltproc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Completion/Unix/Command/_xsltproc 6 Jan 2003 17:45:16 -0000
@@ -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'
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-02-13 15:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-13 15:25 PATCH: completion updates Oliver Kiddle
-- strict thread matches above, loose matches on Subject: below --
2003-01-06 18:03 Oliver Kiddle
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).