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

PATCH: minor completion updates



A few fairly minor updates to completion functions:

  * update encodings for java completion for java 1.4
  * fix completing locales under Linux
  * more updates to _sccs
  * remove some old redundant stuff from _pids
  * use existing completions for some other commands.
  * update _iconv for changes to GNU iconv

Oliver

Index: Completion/Unix/Command/_cdcd
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_cdcd,v
retrieving revision 1.3
diff -u -r1.3 _cdcd
--- Completion/Unix/Command/_cdcd	9 Aug 2002 16:05:46 -0000	1.3
+++ Completion/Unix/Command/_cdcd	12 Mar 2003 18:31:41 -0000
@@ -40,7 +40,7 @@
     'access:configure cddb access method'
     'help:display a help message'
   )
-  _describe 'cdcd command' commands
+  _describe -t commands 'cdcd command' commands
 }
 
 if (( CURRENT == 2 )); then
Index: Completion/Unix/Command/_iconv
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_iconv,v
retrieving revision 1.2
diff -u -r1.2 _iconv
--- Completion/Unix/Command/_iconv	15 Mar 2002 16:26:09 -0000	1.2
+++ Completion/Unix/Command/_iconv	12 Mar 2003 18:31:41 -0000
@@ -1,24 +1,33 @@
 #compdef iconv
 
-local expl curcontext="$curcontext" state line codeset LOCPATH
+local expl curcontext="$curcontext" state line codeset LOCPATH ret=1
 
 if _pick_variant gnu=GNU unix --version; then
 
-  _arguments -C \
-    {'(--from-code --list)-f','(-f --list)--from-code='}'[specify code set of input file]:code set:->codeset' \
-    {'(--to-code --list)-t','(-t --list)--to-code='}'[specify code set for output]:code set:->codeset' \
-    '--list[list all character code sets]' \
-    '--verbose[print progress information]' \
-    {'(--help)-\?','(-\?)--help'}'[display help information]' \
-    '--usage[display a short usage message]' \
-    {'(--version)-V','(-V)--version'}'[print program version]' \
-    '1:file:_files' && return 0
+  local exargs="--list -? --help --usage --version -V"
+  _arguments -C -S -s \
+    "(-f --from-code $exargs)"{-f+,--from-code=}'[specify code set of input file]:code set:->codeset' \
+    "(-t --to-code $exargs)"{-t+,--to-code=}'[specify code set for output]:code set:->codeset' \
+    '(- 1)--list[list all character code sets]' \
+    "($exargs)-c[omit invalid characters from output]" \
+    "(-o --output $exargs)"{-o+,--output=}'[specify output file]:output file:_files' \
+    "(-s --silent --verbose $exargs)"{-s,--silent}'[suppress warnings]' \
+    "(-s --silent $exargs)--verbose[print progress information]" \
+    '(-)'{-\?,--help}'[display help information]' \
+    '(-)--usage[display a short usage message]' \
+    '(-)'{-V,--version}'[print program version]' \
+    '1:input file:_files' && return 0
     
     if [[ $state = codeset ]]; then
-      _wanted codesets expl 'code set' \
-          compadd "$@" ${${(s:,:)$(iconv --list|sed -n '/^$/,$ p')}## #}
+      if compset -P '*/'; then
+        _wanted option expl option compadd "$@" /TRANSLIT && ret=0
+      else
+	_wanted codesets expl 'code set' compadd "$@" -M 'r:|-=* r:|=*' \
+	    ${${${(f)"$(iconv --list|sed -n '/^$/,$ p')"}## #}%//} && ret=0
+      fi
     fi
     
+    return ret
 else
 
   _arguments -C \
Index: Completion/Unix/Command/_java
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_java,v
retrieving revision 1.9
diff -u -r1.9 _java
--- Completion/Unix/Command/_java	17 Feb 2003 10:20:32 -0000	1.9
+++ Completion/Unix/Command/_java	12 Mar 2003 18:31:41 -0000
@@ -382,40 +382,26 @@
 
 encoding)
   tmp=(
-    '8859_1:ISO 8859-1'
-    '8859_2:ISO 8859-2'
-    '8859_3:ISO 8859-3'
-    '8859_4:ISO 8859-4'
-    '8859_5:ISO 8859-5'
-    '8859_6:ISO 8859-6'
-    '8859_7:ISO 8859-7'
-    '8859_8:ISO 8859-8'
-    '8859_9:ISO 8859-9'
-    'Big5:Big5, Traditional Chinese'
-    'CNS11643:CNS 11643, Traditional Chinese'
-    'Cp037:USA, Canada(Bilingual, French), Netherlands, Portugal, Brazil, Australia'
-    'Cp1006:IBM AIX Pakistan (Urdu)'
-    'Cp1025:IBM Multilingual Cyrillic - Bulgaria, Bosnia, Herzegovinia, Macedonia(FYR)'
-    'Cp1026:IBM Latin-5, Turkey'
-    'Cp1046:IBM Open Edition US EBCDIC'
-    'Cp1097:IBM Iran(Farsi)/Persian'
-    'Cp1098:IBM Iran(Farsi)/Persian (PC)'
-    'Cp1112:IBM Latvia, Lithuania'
-    'Cp1122:IBM Estonia'
-    'Cp1123:IBM Ukraine'
-    'Cp1124:IBM AIX Ukraine'
-    'Cp1125:IBM Ukraine (PC)'
-    'Cp1250:Windows Eastern European'
-    'Cp1251:Windows Cyrillic'
+    'US-ASCII:American Standard Code for Information Interchange'
     'Cp1252:Windows Latin-1'
-    'Cp1253:Windows Greek'
-    'Cp1254:Windows Turkish'
-    'Cp1255:Windows Hebrew'
-    'Cp1256:Windows Arabic'
-    'Cp1257:Windows Baltic'
-    'Cp1258:Windows Vietnamese'
-    'Cp1381:IBM OS/2, DOS Peopl'\''es Republic of China (PRC)'
-    'Cp1383:IBM AIX People'\''s Republic of China (PRC)'
+    'ISO-8859-1:ISO 8859-1, Latin alphabet No. 1 '
+    'ISO-8859-15:Latin alphabet No. 9 '
+    'UTF-8:Eight-bit UCS Transformation Format'
+    'UTF-16:Sixteen-bit UCS Transformation Format, byte order identified by an'
+    'UTF-16BE:Sixteen-bit UCS Transformation Format, big-endian byte order '
+    'UTF-16LE:Sixteen-bit UCS Transformation Format, little-endian byte order '
+    'ASCII:American Standard Code for Information Interchange'
+    'ISO8859_1:ISO 8859-1, Latin alphabet No. 1'
+    'UnicodeBig:Sixteen-bit Unicode Transformation Format, big-endian'
+    'UnicodeBigUnmarked:Sixteen-bit Unicode Transformation Format, big-endian'
+    'UnicodeLittle:Sixteen-bit Unicode Transformation Format, little-endian'
+    'UnicodeLittleUnmarked:Sixteen-bit Unicode Transformation Format, little-endian'
+    'UTF8:Eight-bit Unicode Transformation Format'
+    'UTF-16:Sixteen-bit Unicode Transformation Format, byte order'
+    'Big5:Big5, Traditional Chinese'
+    'Big5_HKSCS:Big5 with Hong Kong extensions, Traditional Chinese'
+    'Big5_Solaris:Big5 with seven additional Hanzi ideograph character mappings '
+    'Cp037:USA, Canada (Bilingual, French), Netherlands, Portugal, Brazil, Australia'
     'Cp273:IBM Austria, Germany'
     'Cp277:IBM Denmark, Norway'
     'Cp278:IBM Finland, Sweden'
@@ -423,7 +409,6 @@
     'Cp284:IBM Catalan/Spain, Spanish Latin America'
     'Cp285:IBM United Kingdom, Ireland'
     'Cp297:IBM France'
-    'Cp33722:IBM-eucJP - Japanese (superset of 5050)'
     'Cp420:IBM Arabic'
     'Cp424:IBM Hebrew'
     'Cp437:MS-DOS United States, Australia, New Zealand, South Africa'
@@ -434,7 +419,9 @@
     'Cp850:MS-DOS Latin-1'
     'Cp852:MS-DOS Latin-2'
     'Cp855:IBM Cyrillic'
+    'Cp856:IBM Hebrew'
     'Cp857:IBM Turkish'
+    'Cp858:Variant of Cp850 with Euro character'
     'Cp860:MS-DOS Portuguese'
     'Cp861:MS-DOS Icelandic'
     'Cp862:PC Hebrew'
@@ -448,32 +435,89 @@
     'Cp871:IBM Iceland'
     'Cp874:IBM Thai'
     'Cp875:IBM Greek'
-    'Cp918:IBM Pakistan(Urdu)'
+    'Cp918:IBM Pakistan (Urdu)'
     'Cp921:IBM Latvia, Lithuania (AIX, DOS)'
     'Cp922:IBM Estonia (AIX, DOS)'
     'Cp930:Japanese Katakana-Kanji mixed with 4370 UDC, superset of 5026'
     'Cp933:Korean Mixed with 1880 UDC, superset of 5029'
     'Cp935:Simplified Chinese Host mixed with 1880 UDC, superset of 5031'
-    'Cp937:Traditional Chinese Host miexed with 6204 UDC, superset of 5033'
+    'Cp937:Traditional Chinese Host miexed with 6204 UDC, superset 5033'
     'Cp939:Japanese Latin Kanji mixed with 4370 UDC, superset of 5035'
-    'Cp942:Japanese (OS/2) superset of 932'
+    'Cp942:IBM OS/2 Japanese, superset of Cp932'
+    'Cp942C:Variant of Cp942'
+    'Cp943:IBM OS/2 Japanese, superset of Cp932 and Shift-JIS'
+    'Cp943C:Variant of Cp943'
     'Cp948:OS/2 Chinese (Taiwan) superset of 938'
     'Cp949:PC Korean'
+    'Cp949C:Variant of Cp949'
     'Cp950:PC Chinese (Hong Kong, Taiwan)'
     'Cp964:AIX Chinese (Taiwan)'
     'Cp970:AIX Korean'
-    'EUCJIS:JIS, EUC Encoding, Japanese'
-    'GB2312:GB2312, EUC encoding, Simplified Chinese'
+    'Cp1006:IBM AIX Pakistan (Urdu)'
+    'Cp1025:IBM Multilingual Cyrillic (Bulgaria, Bosnia)'
+    'Cp1025:IBM Multilingual Cyrillic - Bulgaria, Bosnia, Herzegovinia, Macedonia (FYR)'
+    'Cp1026:IBM Latin-5, Turkey'
+    'Cp1046:IBM Arabic - Windows'
+    'Cp1097:IBM Iran (Farsi)/Persian'
+    'Cp1098:IBM Iran (Farsi)/Persian (PC)'
+    'Cp1112:IBM Latvia, Lithuania'
+    'Cp1122:IBM Estonia'
+    'Cp1123:IBM Ukraine'
+    'Cp1124:IBM AIX Ukraine'
+    'Cp1140:Variant of Cp037 with Euro character'
+    'Cp1141:Variant of Cp273 with Euro character'
+    'Cp1142:Variant of Cp277 with Euro character'
+    'Cp1143:Variant of Cp278 with Euro character'
+    'Cp1144:Variant of Cp280 with Euro character'
+    'Cp1145:Variant of Cp284 with Euro character'
+    'Cp1146:Variant of Cp285 with Euro character'
+    'Cp1147:Variant of Cp297 with Euro character'
+    'Cp1148:Variant of Cp500 with Euro character'
+    'Cp1149:Variant of Cp871 with Euro character'
+    'Cp1250:Windows Eastern European'
+    'Cp1251:Windows Cyrillic'
+    'Cp1253:Windows Greek'
+    'Cp1254:Windows Turkish'
+    'Cp1255:Windows Hebrew'
+    'Cp1256:Windows Arabic'
+    'Cp1257:Windows Baltic'
+    'Cp1258:Windows Vietnamese'
+    "Cp1381:IBM OS/2, DOS People's Republic of China (PRC)"
+    "Cp1383:IBM AIX People's Republic of China (PRC)"
+    'Cp33722:IBM-eucJP - Japanese (superset of 5050)'
+    'EUC_CN:GB2312, EUC encoding, Simplified Chinese'
+    'EUC_JP:JIS X 0201, 0208, 0212, EUC encoding, Japanese'
+    'EUC_KR:KS C 5601, EUC encoding, Korean'
+    'EUC_TW:CNS11643 (Plane 1-3), EUC encoding, Traditional Chinese'
+    'GB18030:Simplified Chinese, PRC standard'
     'GBK:GBK, Simplified Chinese'
-    'ISO2022CN:ISO 2022 CN, Chinese'
-    'ISO2022CN_CNS:CNS 11643 in ISO-2022-CN form, T. Chinese'
-    'ISO2022CN_GB:GB 2312 in ISO-2022-CN form, S. Chinese'
+    'ISCII91:ISCII91 encoding of Indic scripts'
+    'ISO2022CN:ISO 2022 CN, Chinese (conversion to Unicode only)'
+    'ISO2022CN_CNS:CNS 11643 in ISO 2022 CN form, Traditional Chinese'
+    'ISO2022CN_GB:GB 2312 in ISO 2022 CN form, Simplified Chinese'
+    'ISO2022JP:JIS X 0201, 0208 in ISO 2022 form, Japanese'
     'ISO2022KR:ISO 2022 KR, Korean'
-    'JIS:JIS, Japanese'
-    'JIS0208:JIS 0208, Japanese'
+    'ISO8859_2:ISO 8859-2, Latin alphabet No. 2'
+    'ISO8859_3:ISO 8859-3, Latin alphabet No. 3'
+    'ISO8859_4:ISO 8859-4, Latin alphabet No. 4'
+    'ISO8859_5:ISO 8859-5, Latin/Cyrillic alphabet'
+    'ISO8859_6:ISO 8859-6, Latin/Arabic alphabet'
+    'ISO8859_7:ISO 8859-7, Latin/Greek alphabet'
+    'ISO8859_8:ISO 8859-8, Latin/Hebrew alphabet'
+    'ISO8859_9:ISO 8859-9, Latin alphabet No. 5'
+    'ISO8859_13:ISO 8859-13, Latin alphabet No. 7'
+    'ISO8859_15:ISO 8859-15, Latin alphabet No. 9'
+    'JIS0201:JIS X 0201, Japanese'
+    'JIS0208:JIS X 0208, Japanese'
+    'JIS0212:JIS X 0212, Japanese'
+    'JISAutoDetect:Detects and converts from Shift-JIS, EUC-JP, ISO 2022 JP'
+    'Johab:Johab, Korean'
     'KOI8_R:KOI8-R, Russian'
-    'KSC5601:KS C 5601, Korean'
     'MS874:Windows Thai'
+    'MS932:Windows Japanese'
+    'MS936:Windows Simplified Chinese'
+    'MS949:Windows Korean'
+    'MS950:Windows Traditional Chinese'
     'MacArabic:Macintosh Arabic'
     'MacCentralEurope:Macintosh Latin-2'
     'MacCroatian:Macintosh Croatian'
@@ -489,7 +533,7 @@
     'MacTurkish:Macintosh Turkish'
     'MacUkraine:Macintosh Ukraine'
     'SJIS:Shift-JIS, Japanese'
-    'UTF8:UTF-8'
+    'TIS620:TIS620, Thai'
   )
   _describe 'character encoding' tmp --
   ;;
Index: Completion/Unix/Command/_sccs
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_sccs,v
retrieving revision 1.2
diff -u -r1.2 _sccs
--- Completion/Unix/Command/_sccs	21 Feb 2003 11:01:57 -0000	1.2
+++ Completion/Unix/Command/_sccs	12 Mar 2003 18:31:41 -0000
@@ -6,7 +6,7 @@
   dir="${(M)PREFIX##*/}$finalpath"
   [[ $~dir = (.|..|)/* ]] || dir="${PROJECTDIR:-~+}/$dir"
   compset -P "*/"
-  _wanted file expl file compadd "$@" - $~dir/*(N.:t:s/s.//) && ret=0
+  _wanted file expl file compadd "$@" - $~dir/s.*(N.:t:s/s.//) && ret=0
   PREFIX="$pref"
   IPREFIX="$ipref"
   _wanted sccs-files expl 'sccs file' _files -W ${PROJECTDIR:-~+} \
@@ -20,9 +20,31 @@
 local subcmds ropt copt sfiles finalpath
 
 subcmds=(
-  admin cdc check clean comb create deledit delget delta diffs edit
-  enter fix get help info print prs ptr rmdel sact sccsdiff tell
-  unedit unget val what
+  'admin:modify the flags or checksum of an sccs history file'
+  'cdc:annotate the commentary of an sccs delta'
+  'check:check for files currently being edited'
+  'clean:remove files that can be retrieved from sccs history'
+  'comb:generate scripts to combine deltas'
+  'create:create (initialize) history files'
+  'deledit:check file in and straight out again'
+  'delget:check file in and maintain read-only copy'
+  'delta:check in changes'
+  'diffs:compare working copy with version in sccs history'
+  'edit:retrieve file for editing (check out)'
+  "enter:like create, but omits the final 'sccs get'"
+  'fix:revise a (leaf) delta'
+  'get:retieve a version from the sccs history'
+  'help:get information on sccs commands and error messages'
+  {info,tell}':list files being edited'
+  'print:print history of specified files'
+  'prs:display delta table for an sccs file'
+  'prt:display the delta table, but omit the MR field'
+  'rmdel:remove specfied delta from history file'
+  'sact:show editing activity status of an sccs file'
+  'sccsdiff:compare two versions from sccs history'
+  {unedit,unget}':undo check out'
+  'val:validate history file'
+  'what:display any ID keyword strings in a file'
 )
 
 ropt='-r+[specify sccs delta id]:sccs delta id'
@@ -37,7 +59,7 @@
     '*::command:->subcmd' && return 0
 
   if (( CURRENT == 1 )); then
-    _wanted commands expl 'sccs command' compadd -a subcmds
+    _describe -t commands 'sccs command' subcmds
     return
   fi
   service="$words[1]"
@@ -102,9 +124,10 @@
   ;;
   fix) _arguments "$ropt" "$sfiles";;
   help)
-    _alternative \
-      "commands:sccs command:(${(j: :)subcmds})" \
-      'message-codes:sccs message code:' 
+    [[ $PREFIX$SUFFIX = [0-9]# ]] &&
+        _message -e message-codes "sccs message code"
+    subcmds+=( "stuck:help on help" )
+    _describe -t commands 'sccs command' subcmds
   ;;
   prs)
     _arguments "$sfiles" "$ropt" "$copt" \
@@ -128,6 +151,11 @@
     ;;
   rmdel) _arguments "$ropt" "$sfiles";;
   sccsdiff) _diff_options diff "$ropt" "$sfiles";;
+  unedit|unget)
+    _arguments "$sfiles" "$ropt" \
+      '-s[silent]' \
+      '-n[retain the retrieved version]'
+    ;;
   val)
     _arguments "$sfiles" "$ropt" \
       '-s[silent]' \
Index: Completion/Unix/Type/_locales
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_locales,v
retrieving revision 1.1
diff -u -r1.1 _locales
--- Completion/Unix/Type/_locales	13 Mar 2002 09:28:05 -0000	1.1
+++ Completion/Unix/Type/_locales	12 Mar 2003 18:31:41 -0000
@@ -1,9 +1,10 @@
-#compdef -value-,LANG,-default- -P -value-,LC_*,-default-
+#compdef -value-,LANG,-default- -value-,LANGUAGE,-default- -P -value-,LC_*,-default-
 
 local locales
 
 if (( $+commands[locale] )); then
   locales=( $(_call_program locales locale -a) )
+  [[ $OSTYPE = linux-gnu ]] && locales=( ${locales/utf8/UTF-8} )
 else
   locales=( /usr/lib/locale/*(:t) )
 fi
Index: Completion/Unix/Type/_pids
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_pids,v
retrieving revision 1.1
diff -u -r1.1 _pids
--- Completion/Unix/Type/_pids	2 Apr 2001 11:35:26 -0000	1.1
+++ Completion/Unix/Type/_pids	12 Mar 2003 18:31:41 -0000
@@ -1,9 +1,9 @@
-#autoload
+#compdef pflags pcred pmap pldd psig pstack pfiles pwdx pstop prun pwait ptree
 
 # If given the `-m <pattern>' option, this tries to complete only pids
 # of processes whose command line match the `<pattern>'.
 
-local out pids list expl match desc listargs args all nm ret=1
+local out pids list expl match desc listargs all nm ret=1
 
 _tags processes || return 1
 
@@ -19,8 +19,6 @@
   match="*[[:blank:]]*[[/[:blank:]]$PREFIX*$SUFFIX*"
   nm="$compstate[nmatches]"
 fi
-
-zstyle -s ":completion:${curcontext}:processes" command args
 
 out=( "${(@f)$(_call_program processes ps 2>/dev/null)}" )
 desc="$out[1]"
Index: Completion/Unix/Type/_users
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_users,v
retrieving revision 1.3
diff -u -r1.3 _users
--- Completion/Unix/Type/_users	6 Aug 2001 14:42:04 -0000	1.3
+++ Completion/Unix/Type/_users	12 Mar 2003 18:31:41 -0000
@@ -1,4 +1,4 @@
-#compdef passwd groups userdel
+#compdef passwd groups userdel chage chfn chsh
 
 local expl users
 



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