Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Unexpected behavior for completion funcion _remote_files()
- X-seq: zsh-workers 39295
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Unexpected behavior for completion funcion _remote_files()
- Date: Mon, 12 Sep 2016 17:30:15 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1473694216; bh=WxlBgT4qDY3uj/SpD7fU4wnXNlgW9rLqQxMLuTWLwfQ=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=JdWiX4JXuidDhY9ug97pPLcSaO3w7VkIJV3WMKqEOkcXrzmF1GjszYHfSFoyJL7oz7VrpojTOIvD8/Ex71QtkkC1nQK3UubQ2YhHAxwhhLBfgph6mbiKemg9Mnk+O22wVCHlEq9JDNLjmgUdAQ8skg2vzKFhzZxKPL/iqkZ+80YFREje+fIcfWGoaXTFj4yz3FMgfQs7VwsHLOf5Y38Xc1cv/+qrdfbMU/bLeJWLgMucH32BLpXXU74y6AHMBPEZnKh24ogTh9QR8ywuO8N3UIYLCSfjPUYMy1e/MOo0rON8D0CqE14PTkRRvnTtgwrZ5hIUTGzQKZaZ+E1Xh1UB7A==
- In-reply-to: <20160906221624.GA4800@fujitsu.shahaf.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CA+JhjB_Ry--Va9-Vz4z_6V7iEeEpJ2UbdAsFJFPe7vYcknB60A@mail.gmail.com> <95820.1473177359@hydra.kiddle.eu> <20160906221624.GA4800@fujitsu.shahaf.local2>
On 6 Sep, Daniel Shahaf wrote:
> > + args=( ${argv[1,(I)--]} )
>
> Should be (i), not (I), in case the [<cmd options>] themselves contain
> a '--' word.
I had intentionally used (I) to cope with the case where there is no
'--' on the line at all.
This should handle either case.
Oliver
diff --git a/Completion/Unix/Type/_remote_files b/Completion/Unix/Type/_remote_files
index 54bd438..dbfb561 100644
--- a/Completion/Unix/Type/_remote_files
+++ b/Completion/Unix/Type/_remote_files
@@ -38,9 +38,9 @@ if zstyle -T ":completion:${curcontext}:files" remote-access; then
zparseopts -D -E -a args / g:=glob h:=host
(( $#host)) && shift host || host="${IPREFIX%:}"
- args=( ${argv[1,(I)--]} )
+ args=( ${argv[1,(i)--]} )
shift ${#args}
- args[-1]=()
+ [[ args[-1] = -- ]] && args[-1]=()
# Command to run on the remote system.
cmd="$1"
shift
Messages sorted by:
Reverse Date,
Date,
Thread,
Author