From: Bart Schaefer <schaefer@brasslantern.com>
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: why '_file -/' completes files if there is no directory?
Date: Thu, 08 Aug 2013 22:59:13 -0700 [thread overview]
Message-ID: <130808225913.ZM25757@torch.brasslantern.com> (raw)
In-Reply-To: <F0534C0F-F6B9-4D5A-B51E-42D344724333@kba.biglobe.ne.jp>
On Aug 9, 1:34am, Jun T. wrote:
}
} Interestingly, 'gcc -I<TAB>' gives nothing, i.e., not completes
} normal files nor gives a warning.
} 'gcc -I./<TAB>' does give a warning, though.
This comes down to some oddness in _describe. In the first case (no
warnings), "compdescribe -g csl2 _args _tmpm _tmpd" succeeds so a
compadd call is made, _ret=0 is assigned, and _describe returns 0
without reaching the end of the _tags loop.
In the second case, compdescribe fails so _describe falls out of the
_tags loop and returns 1. You mention that:
} This happens only if the optspec given to _arguments has the form '*-I-'.
In this form, the string "-I" is provided to compadd as a possible
completion (because it is allowed to appear more than once on the
command line). With the form -I- it is not, because it's allowed only
once; with *-I the code takes an entirely different path because a
separate word is being completed, and _describe is never called.
The result of all this is that with an optspec in the "*-I-" format,
the -I by itself is treated as successful but ambiguous completion,
rather than as a finished option string that needs its argument. I
think this is probably a bug in comparguments -- it should be able to
tell from the single colon in "*-I-:header file ..." that -I can't
appear a second time without first filling in its mandatory argument
-- but like most of us I'm lost as to whether the problem is with
computil.c:ca_parse_line during "comparguments -i", or whether it's
actually a bug in cd_init or cd_get as part of compdescribe, or ...
next prev parent reply other threads:[~2013-08-09 5:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-25 14:09 Jun T.
2013-08-08 6:56 ` Bart Schaefer
2013-08-08 16:34 ` Jun T.
2013-08-09 5:59 ` Bart Schaefer [this message]
2013-08-09 13:27 ` Jun T.
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=130808225913.ZM25757@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--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).