zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: zsh-workers@zsh.org
Subject: Re: Unexpected behavior for completion funcion _remote_files()
Date: Mon, 12 Sep 2016 17:30:15 +0200	[thread overview]
Message-ID: <24775.1473694215@hydra.kiddle.eu> (raw)
In-Reply-To: <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


  reply	other threads:[~2016-09-12 15:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-06 14:34 Yoshio Hanawa
2016-09-06 15:55 ` Oliver Kiddle
2016-09-06 17:26   ` Yoshio Hanawa
2016-09-06 22:16   ` Daniel Shahaf
2016-09-12 15:30     ` Oliver Kiddle [this message]
2016-11-03 14:59       ` Daniel Shahaf
2016-11-03 15:37         ` Bart Schaefer

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=24775.1473694215@hydra.kiddle.eu \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-workers@zsh.org \
    /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).