zsh-users
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Vincent Lefevre <vincent@vinc17.org>
Cc: zsh-users@sunsite.dk
Subject: Re: Completion bug (unzip)
Date: Wed, 02 Jan 2002 17:08:14 +0000	[thread overview]
Message-ID: <3C333E7D.24B06CA3@yahoo.co.uk> (raw)
In-Reply-To: <20020101154601.GA2706@ay.nerim.net>

Vincent Lefevre wrote:
> 
> Happy new year!
> 
> I've found another bug concerning the unzip completion. Consider the
> following line:
> 
>   unzip ../archive/newhtml.zip dir/fi_ -d directory
> 
> where the cursor is just after dir/fi (represented by an underscore).
> If I hit the [Tab] key, I get the error:

This is probably due to the rather poor code for finding the zipfile's
name which handled zip nicely but not unzip. Using $line makes the job
much easier. Why didn't I think of that when I first wrote it.

I'd appreciate if you could check this - I haven't been able to
exactly reproduce the problem as you described (with the zipinfo error).

Oliver

Index: Completion/Unix/Command/_zip
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_zip,v
retrieving revision 1.4
diff -u -r1.4 _zip
--- Completion/Unix/Command/_zip        2001/12/06 16:52:33     1.4
+++ Completion/Unix/Command/_zip        2002/01/02 17:07:59
@@ -1,6 +1,6 @@
 #compdef zip unzip zipinfo
 
-local suffixes suf zipfile izip uzi
+local suffixes suf zipfile uzi
 local expl curcontext="$curcontext" state line
 typeset -A opt_args
 
@@ -114,9 +114,7 @@
     if [[ $service = zip ]] && (( ! ${+opt_args[-d]} )); then
       _files -g '^(#i)*.(zip|[jw]ar)' && return 0
     else
-      (( izip = 1 + words[(I)-[^xi]*] ))
-      (( izip == 1 )) && (( izip++ ))
-      zipfile=( $~words[izip](|.zip|.ZIP) )
+      zipfile=( $~line[1](|.zip|.ZIP) )
       [[ -z $zipfile[1] ]] && return 1
       if [[ $zipfile[1] !=  $_zip_cache_list ]]; then
        _zip_cache_name="$zipfile[1]"

This email has been scanned for all viruses by the MessageLabs SkyScan service. For more information on a pro-active anti-virus service working around the clock, around the globe visit http://www.messagelabs.com/


  reply	other threads:[~2002-01-02 17:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-01 15:46 Vincent Lefevre
2002-01-02 17:08 ` Oliver Kiddle [this message]
2002-01-02 20:01   ` Vincent Lefevre

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=3C333E7D.24B06CA3@yahoo.co.uk \
    --to=okiddle@yahoo.co.uk \
    --cc=vincent@vinc17.org \
    --cc=zsh-users@sunsite.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).