From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Dan Arad <dan1994@gmail.com>
Cc: zsh-workers@zsh.org
Subject: Re: Help Request/Bug Report: comparguments causes _arguments to fail in certain cases
Date: Sun, 3 May 2020 16:58:02 +0000 [thread overview]
Message-ID: <20200503165802.6540ad48@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <CAPPzoJDB3jB7pHUfE7UjY09OHk+r_pgLeYxuaoXhMFGHf-3UCQ@mail.gmail.com>
Dan Arad wrote on Sun, 03 May 2020 10:40 +0300:
> Hi there,
>
> From what I understand, bug reports should be mailed here. If I'm wrong I'd
> be happy to be redirected to the correct medium.
For future reference, you should have addressed your question to
zsh-users@, as the answer to it doesn't involve a change to zsh itself.
Furthermore, it would be helpful to configure your email client to
generate a text/plain part that doesn't surround every line by asterisks
and add spurious blank lines in code blocks.
> What I want to report is probably not a bug, and stems from my
> misunderstanding of compsys. Any help will be greatly appreciated.
> The following is a copy paste of the a this question
> <https://stackoverflow.com/questions/61560687/comparguments-causes-arguments-to-fail-in-certain-cases>
> I asked on stack overflow:
>
Thanks for the cross-reference.
> *1. The script is invoked directly (e.g. ~/script.py)*
>
> *2. The script is invoked through python (e.g. python script.py)*
>
> *3. The script is invoked as a python module (e.g. python -m script)*
>
>
> *I have so far managed to successfully handle the first case, but the
> second case fails to retrieve any completions. Using zsh completion debug
> log I was able to see where things went wrong:*
⋮
> *EDIT:*
>
> *In order to temporarily bypass the problem I tried adding a shift words
> before calling _arguments. This caused comparguments to succeed (!), but
> still causes _arguments to fail with a no arguments message later on.*
>
> *I added the log for this case to the gist linked above.*
Well, for starters, if you «shift words», you should decrement CURRENT
as well.
However, _python uses the «*::…» form of an _arguments optspec,
which should take care of $words/$NUMERIC for you. I assume the reason
it didn't is that you used «compdef -p». Try -P instead? If I'm not
mistaken, that would also handle «python … script.py <TAB>» for you
(where the ellipsis stands for python's --options).
Cheers,
Daniel
prev parent reply other threads:[~2020-05-03 16:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-03 7:40 Dan Arad
2020-05-03 16:58 ` Daniel Shahaf [this message]
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=20200503165802.6540ad48@tarpaulin.shahaf.local2 \
--to=d.s@daniel.shahaf.name \
--cc=dan1994@gmail.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).