Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Completion bug (unzip)
- X-seq: zsh-users 4561
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Vincent Lefevre <vincent@xxxxxxxxxx>
- Subject: Re: Completion bug (unzip)
- Date: Wed, 02 Jan 2002 17:08:14 +0000
- Cc: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20020101154601.GA2706@xxxxxxxxxxxx>
- Sender: kiddleo@xxxxxxxxxxxxxxxxx
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/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author