zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: completion
Date: Thu, 26 Aug 1999 14:20:11 +0200 (MET DST)	[thread overview]
Message-ID: <199908261220.OAA15915@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Tanaka Akira's message of 26 Aug 1999 19:54:09 +0900


Tanaka Akira wrote:

>
> ...
>
> cvs common options such as --version are completed addition to options
> for cvs diff.
>
> ...
>
> is27e1u11% cvs -e vi  
> unknown cvs command: -e
> option
> --allow-root=     -H                -f                -t
> --help            -Q                -l                -v
> --help-commands   -T                -n                -w
> --help-options    -a                -q                -x
> --help-synonyms   -b                -r                -z
> --version         -d                -s                
> 
> _arguments does not cutoff words in this case. Hm.

Should be fixed by this patch. I also changed the `commands'
parameter's name to `cmds' -- until we find the final solution (hope
that's ok for you).

And then I forgot all those `*'s in `_find'... ahem. I'm so ashamed.

Bye
 Sven

diff -u -r oc/Base/_arguments Completion/Base/_arguments
--- oc/Base/_arguments	Thu Aug 26 14:06:15 1999
+++ Completion/Base/_arguments	Thu Aug 26 14:02:46 1999
@@ -226,7 +226,11 @@
       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 @@
 	  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 @@
             inopt=yes
           else
             def=''
+	    inopt=''
 	  fi
         fi
       fi
@@ -318,11 +327,15 @@
               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 @@
       (( $#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 -u -r oc/Cvs/_cvs_command Completion/Cvs/_cvs_command
--- oc/Cvs/_cvs_command	Thu Aug 26 14:06:17 1999
+++ Completion/Cvs/_cvs_command	Thu Aug 26 14:04:46 1999
@@ -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 -u -r oc/User/_find Completion/User/_find
--- oc/User/_find	Thu Aug 26 11:29:02 1999
+++ Completion/User/_find	Thu Aug 26 13:41:51 1999
@@ -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 -/'

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


             reply	other threads:[~1999-08-26 12:20 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-26 12:20 Sven Wischnowsky [this message]
1999-08-26 13:17 ` Tanaka Akira
1999-08-26 17:56 ` Tanaka Akira
  -- strict thread matches above, loose matches on Subject: below --
2000-02-21  9:50 Sven Wischnowsky
1999-10-28  8:12 Sven Wischnowsky
1999-10-28  6:58 Sven Wischnowsky
1999-10-27  8:42 Sven Wischnowsky
1999-10-27 16:39 ` Bart Schaefer
1999-10-27  7:14 Sven Wischnowsky
1999-10-27 21:26 ` Tanaka Akira
1999-10-26 13:17 Sven Wischnowsky
1999-10-26 13:01 Oliver Kiddle
1999-10-26 13:35 ` Zefram
1999-10-26 11:03 Sven Wischnowsky
1999-10-26 17:17 ` Bart Schaefer
1999-10-26 17:22 ` Tanaka Akira
1999-10-26 17:32   ` Tanaka Akira
1999-08-30  9:30 Sven Wischnowsky
1999-08-27  7:03 Sven Wischnowsky
1999-08-27  8:29 ` Tanaka Akira
1999-08-28  6:01   ` Tanaka Akira
1999-08-26 13:52 Sven Wischnowsky
1999-08-25 12:57 Sven Wischnowsky
1999-08-25 12:54 Sven Wischnowsky
1999-08-25  8:24 Sven Wischnowsky
1999-08-26 10:54 ` Tanaka Akira
1999-08-24 10:43 Sven Wischnowsky
1999-08-25  1:56 ` Tanaka Akira
1999-08-24  9:12 Sven Wischnowsky
1999-08-24 10:04 ` Tanaka Akira
1999-08-23 13:46 Sven Wischnowsky
1999-08-23 16:16 ` Tanaka Akira
1999-08-24 15:56 ` Tanaka Akira
1999-08-23 12:00 Sven Wischnowsky
1999-08-23  9:32 Sven Wischnowsky
1999-08-23 10:54 ` Tanaka Akira
1999-08-20 12:59 Sven Wischnowsky
1999-08-20 23:22 ` Tanaka Akira
1999-08-21  8:39   ` Tanaka Akira
1999-08-21 17:47     ` Tanaka Akira
1999-08-20  7:42 Sven Wischnowsky
1999-08-19 13:59 Sven Wischnowsky
1999-08-19 10:44 Sven Wischnowsky
1999-08-19 14:38 ` Tanaka Akira
1999-08-24 13:46 ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199908261220.OAA15915@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).