* Completion bug (unzip)
@ 2002-01-01 15:46 Vincent Lefevre
2002-01-02 17:08 ` Oliver Kiddle
0 siblings, 1 reply; 3+ messages in thread
From: Vincent Lefevre @ 2002-01-01 15:46 UTC (permalink / raw)
To: zsh-users
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:
zipinfo: cannot find NewHTML, NewHTML.zip or NewHTML.ZIP.
though the file exists. If "-d directory" isn't present, there is no
problem.
--
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/> - 100%
validated HTML - Acorn Risc PC, Yellow Pig 17, Championnat International des
Jeux Mathématiques et Logiques, TETRHEX, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Completion bug (unzip)
2002-01-01 15:46 Completion bug (unzip) Vincent Lefevre
@ 2002-01-02 17:08 ` Oliver Kiddle
2002-01-02 20:01 ` Vincent Lefevre
0 siblings, 1 reply; 3+ messages in thread
From: Oliver Kiddle @ 2002-01-02 17:08 UTC (permalink / raw)
To: Vincent Lefevre; +Cc: zsh-users
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/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Completion bug (unzip)
2002-01-02 17:08 ` Oliver Kiddle
@ 2002-01-02 20:01 ` Vincent Lefevre
0 siblings, 0 replies; 3+ messages in thread
From: Vincent Lefevre @ 2002-01-02 20:01 UTC (permalink / raw)
To: zsh-users
On Wed, Jan 02, 2002 at 17:08:14 +0000, Oliver Kiddle wrote:
> 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).
Thanks, it now works correctly.
--
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/> - 100%
validated HTML - Acorn Risc PC, Yellow Pig 17, Championnat International des
Jeux Mathématiques et Logiques, TETRHEX, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-01-02 20:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-01 15:46 Completion bug (unzip) Vincent Lefevre
2002-01-02 17:08 ` Oliver Kiddle
2002-01-02 20:01 ` Vincent Lefevre
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).