Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: new and updated completions



This makes a number of changes to completion functions.

The -j option to cvs checkout was duplicated.

_user_admin is new and is for the various useradd, groupmod etc
commands. It should work for Solaris and Linux. RedHat/Mandrake add a
couple of options to deal with their stupid single user groups so if
anyone can think of a good way to detect RedHat/Mandrake, please let me
know? Also, please let me know if you have a better idea for this
function's name or think it should be split up?

I'll apply the above to both branches and the following only to the
development branch unless anyone suggests otherwise.

I've rewritten _dd to use _values. It highlights a bug/limitation of
_values: it continues to offer options which have already been
specified as if they were preceded by `*' in the spec. It wouldn't do
this if, for example, the values were comma separated.

I've also made a start of updating functions to make better use of the
grouping of options with the same description. I've changed dict, GNU
diff, GNU grep, loadkeys, GNU ls, GNU patch and wget. Things don't seem
to work perfectly if I type grep --<tab> - the list is messed up but is
fine after grep -<tab>. 

Oliver

Index: Completion/Unix/Command/_cvs
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_cvs,v
retrieving revision 1.7
diff -u -r1.7 _cvs
--- Completion/Unix/Command/_cvs	2001/07/27 11:34:46	1.7
+++ Completion/Unix/Command/_cvs	2001/08/06 14:21:11
@@ -163,7 +163,6 @@
     '(-D)-r+[specify revision]:tag:_cvs_revisions' \
     '(-r)-D+[specify date]:date:_cvs_D' \
     '-j+[merge]:tag:_cvs_revisions' \
-    '-j+[merge]:tag:_cvs_revisions' \
     '*:module:_cvs_modules'
 }
 
Index: Completion/Unix/Command/_dd
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_dd,v
retrieving revision 1.1
diff -u -r1.1 _dd
--- Completion/Unix/Command/_dd	2001/04/02 11:47:45	1.1
+++ Completion/Unix/Command/_dd	2001/08/06 14:21:11
@@ -1,20 +1,14 @@
 #compdef dd
 
-local expl
-
-if compset -P 1 'conv='; then
-  # If there's a comma present, ignore up to the last one.  The
-  # test alone will have that effect.
-  compset -p '*,'
-  _wanted values expl conversion \
-      compadd -qS, ascii ebcdic ibm block unblock lcase ucase swab noerror sync
-elif compset -P 1 'if='; then
-  _description files expl 'input file'
-  _tilde_files "$expl[@]"
-elif compset -P 1 'of='; then
-  _description files expl 'output file'
-  _tilde_files "$expl[@]"
-else
-  _wanted values expl option \
-      compadd -S '=' if of ibs obs bs cbs skip files seek count conv
-fi
+_values -S '=' 'option' \
+  'if[specify input file]:input file:_tilde_files' \
+  'of[specify output file]:output file:_tilde_files' \
+  'ibs[input block size]:block size (bytes)' \
+  'obs[output block size]:block size (bytes)' \
+  'bs[block size]:block size (bytes)' \
+  'cbs[conversion buffer size]:buffer size (bytes)' \
+  'skip[input blocks initially skipped]:blocks' \
+  'seek[output blocks initially skipped]:blocks' \
+  'files[specify number of input files to copy and concatenate]:number of files' \
+  'count[number of input blocks to copy]:blocks' \
+  'conv[specify conversions to apply]:conversion:_values -s , "conversion" ascii ebcdic ibm block unblock lcase ucase swab noerror sync'
Index: Completion/Unix/Command/_dict
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_dict,v
retrieving revision 1.2
diff -u -r1.2 _dict
--- Completion/Unix/Command/_dict	2001/04/02 13:04:05	1.2
+++ Completion/Unix/Command/_dict	2001/08/06 14:21:11
@@ -1,47 +1,28 @@
 #compdef dict
 
 _arguments \
-	'(--host)-h[host]:dict server:_hosts' \
-	'(-h)--host:dict server:_hosts' \
-	'(--port)-p[port]:service:' \
-	'(-p)--port:service:' \
-	'(--database)-d[database]:db name:' \
-	'(-d)--database:db name:' \
-	'(--match)-m[match]' \
-	'(-m)--match' \
-	'(--strategy)-s[strategy]:strategy:' \
-	'(-s)--strategy:strategy:' \
-	'(--nocorrect)-C[nocorrect]' \
-	'(-C)--nocorrect' \
-	'(--config)-c[config]:config file:_files' \
-	'(-c)--config:config file:_files' \
-	'(--dbs)-D[list dbs]' \
-	'(-D)--dbs' \
-	'(--strats)-S[strats]' \
-	'(-S)--strats' \
-	'(--serverhelp)-H[server help]' \
-	'(-H)--serverhelp' \
-	'(--info)-i[db info]:db name:' \
-	'(-i)--info:db name:' \
-	'(--noauth)-a[disable authentication]' \
-	'(-a)--noauth' \
-	'(--user)-u[user]:user name:' \
-	'(-u)--user:user name:' \
-	'(--key)-k[key]:shared secret:' \
-	'(-k)--key:shared secret:' \
-	'(--version)-V[display version]' \
-	'(-V)--version' \
-	'(--license)-L[display license]' \
-	'(-L)--license' \
-	'--help' \
-	'(--verbose)-v[be verbose]' \
-	'(-v)--verbose' \
-	'(--raw)-r[be very verbose]' \
-	'(-r)--raw' \
-	'(--pager)-P[pager]:program:_command_names -e' \
-	'(-P)--pager:_command_names -e:' \
-	'--html' \
-	'--pipesize:buffer size:' \
-	'--client:client text:' \
-	'--debug:debug flag:(verbose raw scan parse pipe serial time)' \
-	':word:_dict_words'
+  '(--host -h)'{--host,-h}'[host]:dict server:_hosts' \
+  '(--port -p)'{--port,-p}'[port]:service:' \
+  '(--database -d)'{--database,-d}'[database]:db name:' \
+  '(--match -m)'{--match,-m}'[match]' \
+  '(--strategy -s)'{--strategy,-s}'[strategy]:strategy:' \
+  '(--nocorrect -C)'{--nocorrect,-C}'[nocorrect]' \
+  '(--config -c)'{--config,-c}'[config]:config file:_files' \
+  '(--dbs -D)'{--dbs,-D}'[list dbs]' \
+  '(--strats -S)'{--strats,-S}'[strats]' \
+  '(--serverhelp -H)'{--serverhelp,-H}'[server help]' \
+  '(--info -i)'{--info,-i}'[db info]:db name:' \
+  '(--noauth -a)'{--noauth,-a}'[disable authentication]' \
+  '(--user -u)'{--user,-u}'[user]:user name:' \
+  '(--key -k)'{--key,-k}'[key]:shared secret:' \
+  '(--version -V)'{--version,-V}'[display version]' \
+  '(--license -L)'{--license,-L}'[display license]' \
+  '--help' \
+  '(--verbose -v)'{--verbose,-v}'[be verbose]' \
+  '(--raw -r)'{--raw,-r}'[be very verbose]' \
+  '(--pager -P)'{--pager,-P}'[pager]:program:_command_names -e' \
+  '--html' \
+  '--pipesize:buffer size:' \
+  '--client:client text:' \
+  '--debug:debug flag:(verbose raw scan parse pipe serial time)' \
+  ':word:_dict_words'
Index: Completion/Unix/Command/_grep
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_grep,v
retrieving revision 1.1
diff -u -r1.1 _grep
--- Completion/Unix/Command/_grep	2001/04/02 11:52:20	1.1
+++ Completion/Unix/Command/_grep	2001/08/06 14:21:11
@@ -1,7 +1,7 @@
 #compdef grep egrep fgrep
 # Ulrik Haugen 2001
 
-local efgrep="" efarguments arguments
+local arguments matchers
 
 (( $+_is_gnu )) || typeset -gA _is_gnu
 
@@ -14,59 +14,50 @@
   fi
 fi
 
-
-[[ "$service" = [ef]grep ]] && efgrep=t
-
-if [[ -z $efgrep ]]; then
-  efarguments=( \
-    '(--extended-regexp -F --fixed-strings)-E[extended regexp]' \
-    '(-E -F --fixed-strings)--extended-regexp' \
-    '(--fixed-strings -E --extended-regexp)-F[fixed strings]' \
-    '(-F -E --extended-regexp)--fixed-strings' \
+if [[ $service != [ef]grep ]]; then
+  matchers='(--extended-regexp --fixed-strings --basic-regexp -E -F -G)'
+  arguments=(
+    $matchers{--extended-regexp,-E}'[use extended regular expression]'
+    $matchers{--fixed-strings,-F}'[use literal strings]'
+    $matchers{--basic-regexp,-G}'[use basic regular expression]'
   )
 fi
 
-arguments=( \
-  '(-e --regexp -f --file)1:pattern:' \
-  {'(--regexp -f --file 1)-e+[regexp]','(-e -f --file 1)--regexp='}':regexp:' \
-  {'(--file -e --regexp 1)-f+[file]','(-f -e --regexp 1)--file='}':pattern file:_files' \
-  \
-  '*:files:_files' \
-  \
-  {'(--after-context)-A+[after context]','(-A)--after-context='}':after context:(1)' \
-  '(--text --binary-files)-a[text]' '(-a --binary-files)--text' \
-  {'(--before-context)-B+[before context]','(-B)--before-context='}':before context:(1)' \
-  {'(--context)-C+[context]','(-C)--context='}':context:(1)' \
-  '(--byte-offset)-b[byte offset]' '(-b)--byte-offset' \
-  '(-a --text -I)--binary-files:binary files:(binary without-match text)' \
-  '(--count)-c[count]' '(-c)--count' \
-  {'(--directories -r --recursive)-d+[directories]','(-d -r --recursive)--directories='}':directories:(read skip recurse grep)' \
-  \
-  $efarguments \
-  \
-  '(--basic-regexp)-G[basic regexp]' '(-G)--basic-regexp' \
-  '(--with-filename)-H[with filename]' '(-H)--with-filename' \
-  '(--no-filename)-h[no filename]' '(-h)--no-filename' \
-  '--help' \
-  '(--binary-files)-I[ignore binary]' \
-  '(--ignore-case)-i[ignore case]' '(-i)--ignore-case' \
-  '(--files-without-match)-L[files without match]' '(-L)--files-without-match' \
-  '(--file-with-matches)-l[files with matches]' '(-l)--files-with-matches' \
-  '--mmap' \
-  '(--line-number)-n[line number]' '(-n)--line-number' \
-  '(--quiet --silent)-q[quiet]' '(-q --quiet)--silent' '(-q --silent)--quiet' \
-  '(--recursive -d --directories)-r[recursive]' '(-r -d --directories)--recursive' \
-  '(--no-mesages)-s[no messages]' '(-s)--no-messages' \
-  '(--version)-V[version]' '(-V)--version' \
-  '(--invert-match)-v[invert match]' '(-v)--invert-match' \
-  '(--word-regexp)-w[word regexp]' '(-w)--word-regexp' \
-  '(--line-regexp)-x[line regexp]' '(-x)--line-regexp' \
-  '(--null)-Z[null]' '(-Z)--null' \
+arguments=( $arguments[@]
+  '(--after-context -A)'{--after-context=,-A+}'[specify lines of trailing context]:lines'
+  '(--text -a --binary-files -I)'{--text,-a}'[process binary file as if it were text]'
+  '(--before-context -B)'{--before-context=,-B+}'[specify lines of leading context]:lines'
+  '(--context,-C)'{--context=,-C+}'[specify lines of context]:lines'
+  '(--byte-offset -b -c)'{--byte-offset,-b}'[print the byte offset with output lines]'
+  '(--text -a -I)--binary-files=[specify type to assume for binary files]:file type:(binary without-match text)'
+  '(--count -c --byte-offset -b --line-number -n)'{--count,-c}'[only print a count of matching lines]'
+  '(--directories -d -r --recursive)'{--directories=,-d+}'[specify handling of directories]:action on directory:(read skip recurse)'
+  '(1)*'{--regexp=,-e+}'[specify pattern]:pattern'
+  '(1)*'{--file=,-f+}'[specify pattern file]:file:_files'
+  '(--with-filename -H --no-filename -h)'{--with-filename,-H}'[print filename with each match]'
+  '(--no-filename -h --with-filename -H --null -Z --files-without-match -L --file-with-matches -l)'{--no-filename,-h}'[suppress printing of filenames]'
+  '(--text -a --binary-files)-I[process binary files as if non-matching]'
+  '(--ignore-case -i -y)'{--ignore-case,-i,-y}'[case-insensitive]'
+  '(--files-without-match -L --file-with-matches -l --no-filename -h)'{--files-without-match,-L}"[output non-matching files' names only]"
+  '(--files-with-matches -l --files-without-match -L --no-filename -h)'{--files-with-matches,-l}"[output matching files' names only]"
+  '(--line-number -n -c)'{--line-number,-n}'[prefix output with line numbers]'
+  '(--quiet --silent -q)'{--quiet,--silent,-q}'[suppress normal output]'
+  '(--recursive -r -d --directories)'{--recursive,-r}'[recurse subdirectories]'
+  '(--no-mesages -s)'{--no-messages,-s}'[suppress messages about unreadable]'
+  '(--version -V)'{--version,-V}'[display version info]'
+  '(--invert-match -v)'{--invert-match,-v}'[select non-matching lines]'
+  '(--word-regexp -w --line-regexp -x)'{--word-regexp,-w}'[force pattern to match only whole words]'
+  '(--line-regexp -x --word-regexp -w)'{--line-regexp,-x}'[force pattern to match only whole lines]'
+  '(--null -Z --no-filename -h)'{--null,-Z}'[print 0 byte after FILE name]'
+  '--help[display help]'
+  '--mmap[memory map input]'
+  '(-e --regexp -f --file)1:pattern:_guard "^--*"'
+  '*:files:_files'
 )
 
 # remove long options?
 [[ -z "$_is_gnu[$words[1]]" ]] &&
-    arguments=( ${${${${arguments:#*\)--*}:#--*}//--[^ )]#/}/\( #\)/} )
+    arguments=( ${${${arguments:#(|*\)(\*|))--*}//--[^ )]#/}/\( #\)/} )
 
-_arguments -s $arguments
+_arguments -s $arguments[@]
 
Index: Completion/Unix/Command/_loadkeys
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_loadkeys,v
retrieving revision 1.3
diff -u -r1.3 _loadkeys
--- Completion/Unix/Command/_loadkeys	2001/05/03 13:05:49	1.3
+++ Completion/Unix/Command/_loadkeys	2001/08/06 14:21:11
@@ -3,22 +3,16 @@
 case $OSTYPE in
   linux*)
     _arguments \
-	'(--clearcompose)-c[clearcompose]' \
-	'(-c)--clearcompose' \
-	'(--default)-d[default]' \
-	'(-d)--default' \
-	'(--help)-h[help]' \
-	'(-h)--help' \
-	'(--mktable)-m[mktable]' \
-	'(-m)--mktable' \
-	'(--clearstrings)-s[clearstrings]' \
-	'(-s)--clearstrings' \
-	'(--verbose)-v[verbose]' \
-	'(-v)--verbose' \
-	':keymap:_files -W /usr/share/keymaps'
+      '(--clearcompose -c)'{--clearcompose,-c}'[clear kernel compose table]' \
+      '(--default -d)'{--default,-d}'[load default keymap file]' \
+      '(--help -h)'{--help,-h}'[display help information]' \
+      '(--mktable -m)'{--mktable,-m}'[output a "defkeymap.c" to stdout]' \
+      '(--clearstrings)'{--clearstrings,-s}'[clear kernel string table]' \
+      '*'{--verbose,-v}'[print more details]' \
+      ':keymap:_files -W /usr/share/keymaps'
   ;;
   solaris*)
-	_files -W /usr/share/lib/keytables
+    _files -W /usr/share/lib/keytables
   ;;
 
   *) _default;;
Index: Completion/Unix/Command/_ls
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_ls,v
retrieving revision 1.2
diff -u -r1.2 _ls
--- Completion/Unix/Command/_ls	2001/05/29 17:54:37	1.2
+++ Completion/Unix/Command/_ls	2001/08/06 14:21:11
@@ -14,79 +14,72 @@
   fi
 fi
 
-arguments=( \
-  '*:files:_files' \
-  \
-  '(--all -A --almost-all)-a[all]' '(-a -A --almost-all)--all' \
-  '(--almost-all -a --all)-A[almost all]' '(-A -a --all)--almost-all' \
-  '(--ignore-backups)-B[ignore backups]' '(-B)--ignore-backups' \
-  '(--directory)-d[directory]' '(-d)--directory' \
-  {'(--ignore)-I+[ignore]','(-I)--ignore='}':ignore:' \
-  '(--dereference)-L[dereference]' '(-L)--dereference' \
-  '(--recursive)-R[recursive]' '(-R)--recursive' \
-  \
-  '(--no-group)-G[no group]' '(-G)--no-group' \
-  '(--human-readable -H --si)-h[human readable]' '(-h -H --si)--human-readable' \
-  '(--si -h --human-readable)-H[si]' '(-H -h --human-readable)--si' \
-  '(--inode)-i[inode]' '(-i)--inode' \
-  \
-  '(--format -o -1 -C -m -x)-l[long]' \
-  '(--format -l --no-group -1 -C -m -x)-o[no group, long]' \
-  '(--format -l -o -C -m -x)-1[single column]' \
-  '(--format -l -o -1 -m -x)-C[sort vertically]' \
-  '(--format -l -o -1 -C -x)-m[comma separated]' \
-  '(--format -l -o -1 -C -m)-x[sort horizontally]' \
-  '(-l -o -1 -C -m -x)--format=:format:(verbose long commas horizontal across vertical single-column)' \
-  \
-  '(--size -f)-s[size]' '(-s -f)--size' \
-  \
-  '(--time -u)-c[status change time]' \
-  '(--time -c)-u[access time]' \
-  '(-c -u)--time=:time:(ctime status use atime access)' \
-  \
-  '(-a --all -U -l --format -s --size -t --sort)-f[no sort, all]' \
-  '(--reverse)-r[reverse]' '(-r)--reverse' \
-  \
-  '(--sort -t -U -v -X)-S[sort by size]' \
-  '(--sort -S -U -v -X)-t[sort by time]' \
-  '(--sort -S -t -v -X)-U[no sort]' \
-  '(--sort -S -t -U -X)-v[sort by version]' \
-  '(--sort -S -t -U -v)-X[sort by extension]' \
-  '(-S -t -U -v -X)--sort=:sort:(size time none version extension)' \
-  \
-  '--color=-::color:(never always auto)' \
-  \
-  '(--classify --indicator-style -p --file-type)-F[classify]'  \
-  '(-F --indicator-style -p --file-type)--classify' \
-  '(--file-type --indicator-style -F --classify)-p[file type]' \
-  '(-p --indicator-style -F --classify)--file-type' \
-  '(-F --classify -p --file-type)--indicator-style=:indicator style:(none file-type classify)' \
-  \
-  '--full-time' \
-  \
-  '(--kilobytes --block-size)-k[kilobytes]' '(-k --blocksize)--kilobytes' \
-  '(-k --kilobytes)--block-size:blocksize:(1024)' \
-  \
-  '(--numeric-uid-gid)-n[numeric uid, gid]' \
-  {'(--tabsize)-T+[tabsize]','(-T)--tabsize='}':tabsize:(8)' \
-  {'(--width)-w+[width]','(-w)--width='}':width:(80)' \
-  \
-  '(--quoting-style --escape -N --literal -Q --quote-name)-b[escape]' \
-  '(--quoting-style -b -N --literal -Q --quote-name)--escape' \
-  '(--quoting-style -b --escape --literal -Q --quote-name)-N[literal]' \
-  '(--quoting-style -b --escape -N -Q --quote-name)--literal' \
-  '(--quoting-style -b --escape -N --literal --quote-name)-Q[quote name]' \
-  '(--quoting-style -b --escape -N --literal -Q)--quote-name' \
-  '(-b --escape -N --literal -Q --quote-name)--quoting-style=:quoting style:(literal shell shell-always c escape clocale locale)' \
-  \
-  '(--hide-control-chars --show-control-chars)-q[hide control chars]' \
-  '(-q --show-control-chars)--hide-control-chars' \
-  '(-q --hide-control-chars)--show-control-chars' \
-  '--version' \
+arguments=(
+  '(--all -a -A --almost-all)'{--all,-a}'[list entries starting with .]'
+  '(--almost-all -A -a --all)'{--almost-all,-A}'[list all except . and ..]'
+  '(--ignore-backups -B)'{--ignore-backups,-B}"[don't list entries ending with ~]"
+  '(--directory -d)'{--directory,-d}'[list directory entries instead of contents]'
+  '(--ignore,-I)'{--ignore,-I}"[don't list entires matching pattern]:pattern:"
+  '(--dereference -L)'{--dereference,-L}'[list referenced file for sym link]'
+  '(--recursive -R)'{--recursive,-R}'[list subdirectories recursively]'
+ 
+  '(--no-group -G)'{--no-group,-G}'[inhibit display of group information]'
+  '(--human-readable -h -H --si)'{--human-readable,-h}'[print sizes in human readable form]'
+  '(--si -H -h --human-readable)'{--si,-H}'[sizes in human readable form; powers of 1000]'
+  '(--inode -i)'{--inode,-i}'[print file inode numbers]'
+ 
+  '(--format -o -1 -C -m -x)-l[long listing]'
+  '(--format -l --no-group -G -1 -C -m -x)-o[no group, long]'
+  '(--format -l -o -C -m -x)-1[single column output]'
+  '(--format -l -o -1 -m -x)-C[sort vertically]'
+  '(--format -l -o -1 -C -x)-m[comma separated]'
+  '(--format -l -o -1 -C -m)-x[sort horizontally]'
+  '(-l -o -1 -C -m -x)--format=:format:(verbose long commas horizontal across vertical single-column)'
+ 
+  '(--size -s -f)'{--size,-s}'[display size of each file in blocks]'
+ 
+  '(--time -u)-c[status change time]'
+  '(--time -c)-u[access time]'
+  '(-c -u)--time=[specify time to show]:time:(ctime status use atime access)'
+ 
+  '(-a --all -U -l --format -s --size -t --sort --full-time)-f[unsorted, all, short list]'
+  '(--reverse)'{--reverse,-r}'[reverse sort order]'
+ 
+  '(--sort -t -U -v -X)-S[sort by size]'
+  '(--sort -S -U -v -X)-t[sort by modification time]'
+  '(--sort -S -t -v -X)-U[unsorted]'
+  '(--sort -S -t -U -X)-v[sort by version (filename treated numerically)]'
+  '(--sort -S -t -U -v)-X[sort by extension]'
+  '(-S -t -U -v -X)--sort=:sort:(size time none version extension)'
+ 
+  '--color=-[control use of color]:color:(never always auto)'
+ 
+  '(--classify -F --indicator-style -p --file-type)'{--classify,-F}'[append file type indicators]' 
+  '(--file-type -p --indicator-style -F --classify)'{--file-type,-p}'[append file type indicators except *]'
+  '(-F --classify -p --file-type)--indicator-style=:indicator style:(none file-type classify)'
+ 
+  '(-f)--full-time[list both full date and full time]'
+ 
+  '(--kilobytes -k --block-size)'{--kilobytes,-k}'[use block size of 1k]'
+  '(-k --kilobytes)--block-size=[specify block size]:block size (bytes):(1024)'
+ 
+  '(--numeric-uid-gid -n)'{--numeric-uid-gid,-n}'[numeric uid, gid]'
+  '(--tabsize -T)'{--tabsize=,-T+}'[specify tab size]:tab size'
+  '(--width -w)'{--width=,-w+}'[specify screen width]:screen width'
+ 
+  '(--quoting-style -b --escape -N --literal -Q --quote-name)'{--escape,-b}'[print octal escapes for control characters]'
+  '(--quoting-style -b --escape -N --literal -Q --quote-name)'{--literal,-N}'[print raw characters]'
+  '(--quoting-style -b --escape -N --literal -Q --quote-name)'{--quote-name,-Q}'[quote names]'
+  '(-b --escape -N --literal -Q --quote-name)--quoting-style=:quoting style:(literal shell shell-always c escape clocale locale)'
+ 
+  '(--hide-control-chars -q --show-control-chars)'{--hide-control-chars,-q}'[hide control chars]'
+  '(-q --hide-control-chars)--show-control-chars'
+  '--version[display version information]'
+  '*:files:_files'
 )
 
 # remove long options?
 [[ -z "$_is_gnu[$words[1]]" ]] &&
-    arguments=( ${${${${arguments:#*\)--*}:#--*}//--[^ )]#/}/\( #\)/} )
+    arguments=( ${${${arguments:#(|*\))--*}//--[^ )]#/}/\( #\)/} )
 
 _arguments -s $arguments
Index: Completion/Unix/Command/_patch
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_patch,v
retrieving revision 1.1
diff -u -r1.1 _patch
--- Completion/Unix/Command/_patch	2001/04/02 11:59:23	1.1
+++ Completion/Unix/Command/_patch	2001/08/06 14:21:11
@@ -56,7 +56,7 @@
 
     '* --quoting-style=WORD[, ]*' '--quoting-style=[quoting style]:quoting style:(literal shell shell-always c escape)'
 
-    '*(\[-[a-zA-Z]#b[a-zA-Z]#\]| -b[, ])*' '(--backup)-b[back up original]'
+    '*(\[-[a-zA-Z]#b[a-zA-Z]#\]| -b[, ])*' '(--backup)-b[backup original]'
     '* --backup[, ]*' '(-b)--backup[backup original]'
     '* --backup-if-mismatch[, ]*' '(--no-backup-if-mismatch)--backup-if-mismatch[back up if not match exactly]'
     '* --no-backup-if-mismatch[, ]*' '(--backup-if-mismatch)--no-backup-if-mismatch[back up only if otherwise requested]'
Index: Completion/Unix/Command/_user_admin
===================================================================
RCS file: _user_admin
diff -N _user_admin
--- /dev/null	Thu May 24 22:33:05 2001
+++ _user_admin	Mon Aug  6 07:21:12 2001
@@ -0,0 +1,67 @@
+#compdef useradd usermod groupadd groupmod
+
+local args shells home=${${words[(r)-D]:+b}:-d} sun=" -s"
+
+if [[ $service = user* ]]; then
+  if [[ -r /etc/shells ]]; then
+    shells=( $(</etc/shells) )
+  else
+    shells=( ${(M)commands:#*/(|[abckz]|tc|ba)sh} )
+  fi
+
+  args=(
+    '(-D)-c+[comment]:comment'
+    "(-D)-${home}+[home directory]:home directory:_directories -W /"
+    '(-D)-e+[specify expriration date]:expiration date (YYYY-MM-DD)'
+    '(-D)-f+[specify inactive days]:inactive days'
+    '(-D)-g+[initial group]:initial group:_groups'
+    '(-D)-G+[supplementary groups]:supplementary groups:_groups -S,'
+    "(-D)-s+[shell]:shell:( $shells /dev/null )"
+    '(-D)-m[create home directory]'
+    '(-D)-u[uid]:uid'
+    '(-D)-o[allow non unique uid]'
+  )
+  [[ $OSTYPE = linux* ]] && args=( $args[@] 
+      '(-D)-p+[specify encrypted password]:encrypted password' )
+
+  if [[ $service = useradd ]]; then
+    if [[ $OSTYPE = linux* ]]; then
+      args=( $args[@]
+	"(-D -k)-M[don't create home]"
+	'(-D)-r[create system account]'
+	"(-D)-n[don't create mirrored user]"
+      )
+      unset sun
+    fi
+    args=( $args[@]
+      "(-c -G -m -k -M -p -u -o -n -r$sun)-D[modify or display defaults]"
+      '(-D -M)-k[skeleton home directory]:skeleton directory:_directories -W /'
+      ':username'
+    )
+  else
+    [[ $OSTYPE = linux* ]] && args=( $args[@]
+	"(-U)-L[lock user's password]"
+	"(-L)-U[unlock user's password]"
+    )
+    args=( $args[@]
+      '-l[specify new user name]:new username'
+      ':username:_users'
+    )
+  fi
+else
+  args=( '-g+[gid]:gid' '-o[allow non unique gid]' )
+  if [[ $service = groupadd ]]; then
+    args=( $args[@] ':group name' )
+    [[ $OSTYPE = linux* ]] && args=( $args[@]
+      '-r[create system group]'
+      '-f[force]'
+    )
+  else
+    args=( $args[@] 
+      '-n[specify new group name]:new group name'
+      ':group name:_groups'
+    )
+  fi
+fi
+
+_arguments -A "-*" -s $args[@]
Index: Completion/Unix/Command/_wget
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_wget,v
retrieving revision 1.2
diff -u -r1.2 _wget
--- Completion/Unix/Command/_wget	2001/05/29 17:54:37	1.2
+++ Completion/Unix/Command/_wget	2001/08/06 14:21:12
@@ -3,72 +3,67 @@
 local curcontext="$curcontext" state line
 typeset -A opt_args
 
-local tmp1 tmp2
-
 _arguments -C -s \
-  '(--version)-V[version]' '(-V)--version' \
-  '(--help)-h[help]' '(-h)--help' \
-  '(--background)-b[background]' '(-b)--background' \
-  {'(--execute)-e+[execute]','(-e)--execute='}':.wgetrc command:' \
-  {'(--output-file)-o+[output file]','(-o)--output-file='}':log file to output:_files' \
-  {'(--append-output)-a+[append output file]','(-a)--append-output='}':log file to append:_files' \
-  '(--debug)-d[debug]' '(-d)--debug' \
-  '(--quiet)-q[quiet]' '(-q)--quiet' \
-  '(--verbose)-v[verbose]' '(-v)--verbose' \
-  '*-n+[no]:flags:->noflags' \
-  {'(--input-file)-i+[input file]','(-i)--input-file='}':file containing URLs:_files' \
-  '(--force-html)-F[force html]' '(-F)--force-html' \
-  {'(--base)-B+[prepend URL to relative links]','(-B)--base='}':base URL:_urls' \
+  '(--version -V)'{--version,-V}'[display version info]' \
+  '(--help -h)'{--help,-h}'[display help]' \
+  '(--background -b)'{--background,-b}'[run in background]' \
+  '(--execute -e)'{--execute=,-e+}'[execute .wgetrc command]:.wgetrc command' \
+  '(--output-file -o --append-output -a)'{--output-file=,-o+}'[specify output logfile]:log file to output:_files' \
+  '(--append-output -a --output-file -o)'{--append-output=,-a+}'[specify output logfile to append to]:log file to append:_files' \
+  '(--debug -d)'{--debug,-d}'[turn on debug output]' \
+  '(--quiet -q --verbose -v --non-verbose -nv)'{--quiet,-q}'[turn off output]' \
+  '(--quiet -q --verbose -v --non-verbose -nv)'{--verbose,-v}'[turn on verbose output]' \
+  '*-n+[turn off flags]:flags:->noflags' \
+  '(--input-file -i)'{--input-file=,-i+}'[specify input file]:file containing URLs:_files' \
+  '(--force-html -F)'{--force-html,-F}'[treat input file as html]' \
+  '(--base -B)'{--base=,-B+}'[prepend URL to relative links]:base URL:_urls' \
   '--bind-address=:address to bind to (hostname or IP):_hosts' \
-  {'(--tries)-t+[tries]','(-t)--tries='}':number of retries:(0)' \
-  {'(--output-document)-O+[output document]','(-O)--output-document='}':output file:_files' \
-  '(--continue)-c[continue]' '(-c)--continue' \
-  '--dot-style=:display style:(default binary mega giga micro)' \
-  '(--timestamping)-N[timestamping]' '(-N)--timestamping' \
-  '(--server-response)-S[server response]' '(-S)--server-response' \
-  '--spider' \
-  {'(--timeout)-T+[timeout]','(-T)--timeout='}':read timeout(seconds):' \
-  {'(--wait)-w+[wait]','(-w)--wait='}':wait between retrievals(seconds):' \
-  '--waitretry=:seconds to wait between retries of a retrieval:' \
-  {'(--proxy --use-proxy)-Y+[proxy]','(-Y --use-proxy)--proxy=','(-Y --proxy)--use-proxy='}':proxy:(on off)' \
-  {'(--quota)-Q+[quota]','(-Q)--quota='}':number:' \
-  '(--force-directories)-x[force directories]' '(-x)--force-directories' \
-  {'(--directory-prefix)-P+[directory prefix]','(-P)--directory-prefix='}':prefix:_files -/' \
+  '(--tries -t)'{--tries=,-t+}'[set number of retries]:number of retries' \
+  '(--output-document -O)'{--output-document=,-O+}'[specify file to write documents to]:output file:_files' \
+  '(--continue -c)'{--continue,-c}'[continue getting an existing file]'  \
+  '--dot-style=[set retrieval display style]:display style:(default binary mega giga micro)' \
+  '(--timestamping -N)'{--timestamping,-N}'[retrieve only files newer than existing]' \
+  '(--server-response -S)'{--server-response,-S}'[print server response]' \
+  "--spider[don't download anything]" \
+  '(--timeout -T)'{--timeout=,-T+}'[specify read timeout]:read timeout (seconds)' \
+  '(--wait,-w)'{--wait=,-w+}'[specify wait between retrievals]:wait between retrievals (seconds)' \
+  '--waitretry=:wait between retries of a retrieval (seconds)' \
+  '(--proxy -Y)'{--proxy=,-Y+}'[turn proxy on or off]:proxy use:(on off)' \
+  '(--quota -Q)'{--quota=,-Q+}'[set retrieval quota]:number' \
+  '(--force-directories -x)'{--force-directories,-x}'[force creation of directories]' \
+  '(--directory-prefix -P)'{--directory-prefix=,-P+}'[specify prefix to save files to]:prefix:_files -/' \
   '--cut-dirs=:number:' \
   '--http-user=:user:' \
   '--http-passwd=:password:' \
-  '(--html-extension)-E[save all text/html files with a .html extension]' \
-  '(-E)--html-extension' \
-  '--ignore-length' \
+  '(--html-extension -E)'{--html-extension,-E}'[save all text/html files with a .html extension]' \
+  "--ignore-length[ignore \`Content-Length' header field]" \
   '--header=:string:' \
   '--proxy-user=:user:' \
   '--proxy-passwd=:password:' \
   '--referer=:url:_urls' \
-  '(--save-headers)-s[save headers]' '(-s)--save-headers' \
-  {'(--user-agent)-U+[user agent]','(-U)--user-agent='}':user-agent:' \
+  '(--save-headers -s)'{--save-headers,-s}'[save http headers]' \
+  '(--user-agent -U)'{--user-agent=,-U+}'[specify user agent to identify as]:user-agent' \
   '--retr-symlinks' \
-  {'(--glob)-g+[glob]','(-g)--glob='}':glob:(on off)' \
+  '(--glob -g)'{--glob=,-g+}'[turn file globbing on or off]:glob:(on off)' \
   '--passive-ftp' \
-  '(--recursive)-r[recursive]' '(-r)--recursive' \
-  {'(--level)-l+[level]','(-l)--level='}':level:(0)' \
+  '(--recursive -r)'{--recursive,-r}'[recurse subdirectories]' \
+  '(--level -l)'{--level=,-l+}'[specify maximum recursion depth]:level' \
   '--delete-after' \
-  '(--convert-links)-k[convert links]' '(-k)--convert-links' \
-  '(--backup-converted)-K[backup files before conversion]' \
-  '(-K)--backup-converted' \
-  '(--mirror)-m[mirror]' '(-m)--mirror' \
-  '(--page-requisites)-p[get all images needed to display page]' \
-  '(-p)--page-requisites' \
-  {'(--accept)-A+[accept]','(-A)--accept='}':accepted extensions:' \
-  {'(--reject)-R+[reject]','(-R)--reject='}':rejected extensions:' \
-  {'(--domains)-D+[domains]','(-D)--domains='}':accepted domains:' \
+  '(--convert-links -k)'{--convert-links,-k}'[convert links to be relative]' \
+  '(--backup-converted -K)'{--backup-converted,-K}'[backup files before conversion]' \
+  '(--mirror -m -r -N -l)'{--mirror,-m}'[mirror (-r -N -l inf -nr)]' \
+  '(--page-requisites -p)'{--page-requisites,-p}'[get all images needed to display page]' \
+  '(--accept -A)'{--accept=,-A+}'[specify accepted extensions]:extensions' \
+  '(--reject -R)'{--reject=,-R+}'[specify rejected extensions]:extensions' \
+  '(--domains -D)'{--domains=,-D+}'[specify accepted domains]:domains' \
   '--exclude-domains=:rejected domains:' \
   '--follow-ftp' \
   '--follow-tags=:HTML tags:' \
-  {'(--ignore-tags)-G+[ignored HTML tags]','(-G)--ignore-tags='}':HTML tags:' \
-  '(--span-hosts)-H[span hosts]' '(-H)--span-hosts' \
-  '(--relative)-L[follow relative links only]' '(-L)--relative' \
-  {'(--include-directories)-I+[include directories]','(-I)--include-directories='}':allowed directories:' \
-  {'(--exclude-directories)-X+[exclude directories]','(-X)--exclude-directories='}':excluded directories:' \
+  '(--ignore-tags -G)'{--ignore-tags=,-G+}'[spcify ignored HTML tags]:HTML tags' \
+  '(--span-hosts -H)'{--span-hosts,-H}'[span hosts]' \
+  '(--relative -L)'{--relative,-L}'[follow relative links only]' \
+  '(--include-directories -I)'{--include-directories=,-I+}'[include directories]:allowed directories' \
+  '(--exclude-directories -X)'{--exclude-directories=,-X+}'[exclude directories]:excluded directories' \
   '--no-host-lookup' \
   '--no-parent' \
   '--non-verbose' \
@@ -76,16 +71,10 @@
   '--no-directories' \
   '--no-host-directories' \
   '--dont-remove-listing' \
-  '--cache=:cache:(on off)' \
+  '(--cache -C)'{--cache=,-C+}'[(dis)allow server-cached data]:cache:(on off)' \
   '--htmlify=:htmlify:' \
   '--no:no:->noflags' \
   '*:url:_urls' && return 0
-
-#  '--backups:backups:' \
-#  '-W' \
-#  '(--email-address)-E+[email address]' '(-E)--email-address' \
-#  '-C+[cache]:cache:(on off)' \
-#  '--force-hier' \
 
 case "$state" in
 noflags)
Index: Completion/Unix/Type/_diff_options
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_diff_options,v
retrieving revision 1.2
diff -u -r1.2 _diff_options
--- Completion/Unix/Type/_diff_options	2001/05/21 14:44:49	1.2
+++ Completion/Unix/Type/_diff_options	2001/08/06 14:21:12
@@ -49,19 +49,16 @@
   --unchanged-group-format"
 
   _arguments -s \
-    '(-i)--ignore-case[case insensitive]' \
-    '(--ignore-case)-i[case insensitive]' \
-    '(-w)--ignore-all-space[ignore all white space]' \
-    '(--ignore-all-space)-w[ignore all white space]' \
+    '(--ignore-case -i)'{--ignore-case,-i}'[case insensitive]' \
+    '(--ignore-all-space -w)'{--ignore-all-space,-w}'[ignore all white space]' \
     '(-b)--ignore-space-change[ignore changes in the amount of white space]' \
     '(--ignore-space-change)-b[ignore changes in the amount of white space]' \
     '(-B)--ignore-blank-lines[ignore lines that are all blank]' \
     '(--ignore-blank-lines)-B[ignore lines that are all blank]' \
     '(-I)--ignore-matching-lines=[ignore lines that match regex]:line exclusion regex:' \
     '(--ignore-matching-lines)-I+[ignore lines that match regex]:line exclusion regex:' \
-    '(-a)--text[treat all files as text]' \
-    '(--text)-a[treat all files as text]' \
-    "($of $oss)--context=-[context diff]:number of lines of copied context:" \
+    '(--text -a)'{--text,-a}'[treat all files as text]' \
+    "($of $oss)--context=-[output a context diff]:number of lines of copied context:" \
     "($of $oss)-C+[output a context diff]:number of lines of copied context:" \
     "($of $oss)-c[output a context diff]" \
     "($of $oss)--unified=-[output a unified diff]:number of lines of unified context:" \
@@ -95,16 +92,12 @@
     "($ofwl $ouc $oss)--old-line-format=[set old line format]:old line format:" \
     "($ofwl $ouc $oss)--new-line-format=[set new line format]:new line format:" \
     "($ofwl $ouc $oss)--unchanged-line-format=[set unchanged line format]:unchanged line format:" \
-    '(-l)--paginate[output through pr]' \
-    '(--paginate)-l[output through pr]' \
-    '(-t)--expand-tabs[expand tabs to spaces]' \
-    '(--expand-tabs)-t[expand tabs to spaces]' \
-    '(-T)--initial-tab[prepend a tab]' \
-    '(--initial-tab)-T[prepend a tab]' \
+    '(--paginate -l)'{--paginate,-l}'[output through pr]' \
+    '(--expand-tabs -t)'{--expand-tabs,-t}'[expand tabs to spaces]' \
+    '(--initial-tab -T)'{--initial-tab,-T}'[prepend a tab]' \
     '(-r)--recursive[recursively compare subdirectories]' \
     '(--recursive)-r[recursively compare subdirectories]' \
-    '(-N)--new-file[treat absent files as empty]' \
-    '(--new-file)-N[treat absent files as empty]' \
+    '(--new-file -N)'{--new-file,-N}'[treat absent files as empty]' \
     '(-P)--unidirectional-new-file[treat absent first files as empty]' \
     '(--unidirectional-new-file)-P[treat absent first files as empty]' \
     '(-s)--report-identical-files[report when two files are the same]' \
@@ -116,12 +109,10 @@
     '(-S)--starting-file=[set first file in comparison]:start with file:_files' \
     '(--starting-file)-S+[set first file in comparison]:start with file:_files' \
     '--horizon-lines=[set number of lines to keep in prefix and suffix]:number of horizon lines:' \
-    '(-d)--minimal[try to find a smaller set of changes]' \
-    '(--minimal)-d[try to find a smaller set of changes]' \
+    '(--minimal -d)'{--minimal,-d}'[try to find a smaller set of changes]' \
     '(-H)--speed-large-files[assume large files and many small changes]' \
     '(--speed-large-files)-H[assume large files and many small changes]' \
-    '(--version)-v[output version info]' \
-    '(-v)--version[output version info]' \
+    '(--version -v)'{--version,-v}'[output version info]' \
     '--help[help text]' \
     "$@"
 else
Index: Completion/Unix/Type/_groups
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_groups,v
retrieving revision 1.1
diff -u -r1.1 _groups
--- Completion/Unix/Type/_groups	2001/04/02 11:37:41	1.1
+++ Completion/Unix/Type/_groups	2001/08/06 14:21:12
@@ -1,4 +1,4 @@
-#compdef newgrp
+#compdef newgrp groupdel
 
 local expl groups tmp
 
Index: Completion/Unix/Type/_users
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_users,v
retrieving revision 1.2
diff -u -r1.2 _users
--- Completion/Unix/Type/_users	2001/06/25 18:52:15	1.2
+++ Completion/Unix/Type/_users	2001/08/06 14:21:12
@@ -1,4 +1,4 @@
-#compdef passwd groups
+#compdef passwd groups userdel
 
 local expl users



Messages sorted by: Reverse Date, Date, Thread, Author