From 4d86ee0d400f5a3283eacf2307be499bc1392550 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Thu, 26 Aug 1999 12:23:17 +0000 Subject: zsh-workers/7500 --- Completion/Base/_arguments | 21 +++++++-- Completion/Cvs/_cvs_command | 22 ++++----- Completion/User/_find | 110 ++++++++++++++++++++++---------------------- 3 files changed, 83 insertions(+), 70 deletions(-) (limited to 'Completion') diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments index e54aaf7ef..eb6ec51bc 100644 --- a/Completion/Base/_arguments +++ b/Completion/Base/_arguments @@ -226,7 +226,11 @@ while [[ cur -gt 0 ]]; do def="$opts[$ws[1]]" optbeg="$beg" argbeg="$beg" - inopt=yes + if [[ -n "$def" ]]; then + inopt=yes + else + inopt='' + fi [[ -n "$oneshot[$ws[1]]" ]] && unset "opts[$ws[1]]" else uns='' @@ -236,7 +240,11 @@ while [[ cur -gt 0 ]]; do def="$opts[$tmp]" optbeg="$beg" argbeg="$beg" - inopt=yes + if [[ -n "$def" ]]; then + inopt=yes + else + inopt='' + fi uns="${ws[1][2,-1]}" opt='' fi @@ -283,6 +291,7 @@ while [[ cur -gt 0 ]]; do inopt=yes else def='' + inopt='' fi fi fi @@ -318,11 +327,15 @@ while [[ cur -gt 0 ]]; do def="${def#?*[^\\]:*[^\\]:}" optbeg="$beg" argbeg="$beg" - inopt=yes else def='' fi fi + if [[ -n "$def" ]]; then + inopt=yes + else + inopt='' + fi fi fi @@ -453,7 +466,7 @@ else (( $#tmp )) && unset "$tmp[@]" fi - if [[ -n "$opt" ]]; then + if [[ -n "$opt" && "$def" != \** ]]; then # We aren't in an argument directly after a option name, so # all option names are possible matches. diff --git a/Completion/Cvs/_cvs_command b/Completion/Cvs/_cvs_command index 837c7cbb1..d2db059ea 100644 --- a/Completion/Cvs/_cvs_command +++ b/Completion/Cvs/_cvs_command @@ -1,18 +1,18 @@ #autoload -typeset -A commands -commands=(add "ad new" admin "adm rcs" annotate ann - checkout "co get" commit "ci com" diff "di dif" - edit "" editors "" export "exp ex" - history "hi his" import "im imp" init "" - log "lo rlog" login "logon lgn" logout "" - rdiff patch release "re rel" remove "rm delete" - status "st stat" rtag "rt rfreeze" tag "ta freeze" - unedit "" update "up upd" watch "" - watchers "") +typeset -A cmds +cmds=(add "ad new" admin "adm rcs" annotate ann + checkout "co get" commit "ci com" diff "di dif" + edit "" editors "" export "exp ex" + history "hi his" import "im imp" init "" + log "lo rlog" login "logon lgn" logout "" + rdiff patch release "re rel" remove "rm delete" + status "st stat" rtag "rt rfreeze" tag "ta freeze" + unedit "" update "up upd" watch "" + watchers "") if (( CURRENT == 1 )); then - compadd ${(k)commands} || compadd ${(kv)=commands} + compadd ${(k)cmds} || compadd ${(kv)=cmds} else case "$words[1]" in add|ad|new) _cvs_add;; diff --git a/Completion/User/_find b/Completion/User/_find index 4f918e450..368cdcb16 100644 --- a/Completion/User/_find +++ b/Completion/User/_find @@ -1,59 +1,59 @@ #compdef find _arguments \ - '-daystart' \ - '-depth' \ - '-follow' \ - '-help' \ - '-maxdepth:maximum search depth:' \ - '-mindepth:minimum search depth:' \ - '-mount' \ - '-noleaf' \ - '-version' \ - '-xdev' \ - '-amin:access time (minutes):' \ - '-cmin:inode change time (minutes):' \ - '-mmin:modification time (minutes):' \ - '-atime:access time (days):' \ - '-ctime:inode change time (days):' \ - '-mtime:modification time (days):' \ - '-anewer:file to compare (access time):_files' \ - '-cnewer:file to compare (inode change time):_files' \ - '-newer:file to compare (modification time):_files' \ - '-used:access after inode change (days):' \ - '-empty' \ - '-false' \ - '-fstype:filesystem type:(ufs 4.2 4.3 nfs tmp mfs S51K S52K)' \ - '-gid:numeric group ID:' \ - '-group:group:_groups' \ - '-uid:numeric user ID:' \ - '-user:user:_users' \ - '-lname:link pattern to search:' \ - '-ilname:link pattern to search (case insensitive):' \ - '-name:name pattern to search:' \ - '-iname:name pattern to search (case insensitive):' \ - '-path:path pattern to search:' \ - '-ipath:path pattern to search (case insensitive):' \ - '-regex:regular expression to search:' \ - '-iregex:regular expression to search (case insensitive):' \ - '-inum:inode number:' \ - '-links:number of links:' \ - '-nouser' \ - '-nogroup' \ - '-perm:file permission bits:' \ - '-size:file size:' \ - '-true' \ - '-type:file type:(b c d p f l s)' \ - '-xtype:file type:(b c d p f l s)' \ - '-exec:program: _command_names -e:*\;::program arguments: _normal' \ - '-ok:program: _command_names -e:*\;::program arguments: _normal' \ - '-fls:output file:_files' \ - '-fprint:output file:_files' \ - '-fprint0:output file:_files' \ - '-fprintf:output file:_files:output format:' \ - '-print' \ - '-print0' \ - '-printf:output format:' \ - '-prune' \ - '-ls' \ + '*-daystart' \ + '*-depth' \ + '*-follow' \ + '*-help' \ + '*-maxdepth:maximum search depth:' \ + '*-mindepth:minimum search depth:' \ + '*-mount' \ + '*-noleaf' \ + '*-version' \ + '*-xdev' \ + '*-amin:access time (minutes):' \ + '*-cmin:inode change time (minutes):' \ + '*-mmin:modification time (minutes):' \ + '*-atime:access time (days):' \ + '*-ctime:inode change time (days):' \ + '*-mtime:modification time (days):' \ + '*-anewer:file to compare (access time):_files' \ + '*-cnewer:file to compare (inode change time):_files' \ + '*-newer:file to compare (modification time):_files' \ + '*-used:access after inode change (days):' \ + '*-empty' \ + '*-false' \ + '*-fstype:filesystem type:(ufs 4.2 4.3 nfs tmp mfs S51K S52K)' \ + '*-gid:numeric group ID:' \ + '*-group:group:_groups' \ + '*-uid:numeric user ID:' \ + '*-user:user:_users' \ + '*-lname:link pattern to search:' \ + '*-ilname:link pattern to search (case insensitive):' \ + '*-name:name pattern to search:' \ + '*-iname:name pattern to search (case insensitive):' \ + '*-path:path pattern to search:' \ + '*-ipath:path pattern to search (case insensitive):' \ + '*-regex:regular expression to search:' \ + '*-iregex:regular expression to search (case insensitive):' \ + '*-inum:inode number:' \ + '*-links:number of links:' \ + '*-nouser' \ + '*-nogroup' \ + '*-perm:file permission bits:' \ + '*-size:file size:' \ + '*-true' \ + '*-type:file type:(b c d p f l s)' \ + '*-xtype:file type:(b c d p f l s)' \ + '*-exec:program: _command_names -e:*\;::program arguments: _normal' \ + '*-ok:program: _command_names -e:*\;::program arguments: _normal' \ + '*-fls:output file:_files' \ + '*-fprint:output file:_files' \ + '*-fprint0:output file:_files' \ + '*-fprintf:output file:_files:output format:' \ + '*-print' \ + '*-print0' \ + '*-printf:output format:' \ + '*-prune' \ + '*-ls' \ '*:directory:_files -/' -- cgit 1.4.1