Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Completion error message
- X-seq: zsh-users 23101
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Completion error message
- Date: Thu, 25 Jan 2018 21:24:32 +0100
- Authentication-results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.co.uk
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1516912478; bh=S1vIzQNfTtFn/j2VdpvA45/tw7HCAZBrBcxTI3RrWr4=; h=From:References:To:Subject:Date:From:Subject; b=HtEel2mXrEJGO5SN8ooKk+G63eUuCFcGMTrb0A3JeGgrjlF863018RfJz5mUhVlbNx5Y4yyJkv18OWRJNkPgVvBrUE2HLozg8ovxIDp0JOgqtZNeDA/KMZdAZSrlGlKhdkBmhV423QEbFsTzJf8v+HMV5Z1LzP3q7ng8hielOakQBdS2aPCiNotE0KJRkmaPaxxNMj5a4F1zbfOLE33cj1wO4by5FzoHiofGkZHxrlRzW6dbGDenutpW9vuIXnhwKNetPvPx0Pj22yAanNUNx1sBbcMrZXp9mah/NjavHwqegu+4kr2K8IgulbGMXAMFc1Jk1nf51G2pQDigkEbADw==
- In-reply-to: <20180125155058.ukg4xupxl37e7srk@tarpaulin.shahaf.local2>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20180125155058.ukg4xupxl37e7srk@tarpaulin.shahaf.local2>
Daniel Shahaf wrote:
> «rsync -4 -6 --<TAB>» does nothing and prints nothing.
>
> I get why it _does_ nothing — -4 and -6 are mutually exclusive, so the
> command line is invalid and it makes no sense to continue — but
> shouldn't it print an error message?
Note that _rsync uses _arguments sets. Without sets, it will complete
further options. With sets, it is aggressive about disabling
sets such that it can narrow things to the intended set. Unfortunately,
that can easily result in all sets being deactivated.
The inactive option (-6) is seen as an invalid argument when parsing for
each of the two sets. Both sets get disabled and there's no completion.
As I mentioned in 40129, we could do something with marking sets for
fallback and examine them twice.
This also affects things without sets, try this:
_arguments '(-6)-4' '(-4)-6' -a -b '1:arg1:(1)' '2:arg2:(2)'
The -6 option gets taken as the first positional argument and '2' gets
completed. What do you think it should complete there?
Most commands don't like position arguments to look like options.
I'm not especially keen on producing error messages from completion.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author