zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Mikael Magnusson <mikachu@gmail.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: Completion error message
Date: Sat, 27 Jan 2018 18:16:51 -0800	[thread overview]
Message-ID: <CAH+w=7YaRQAgdHzUE-YF+XZoLobiT=gynoY9imuUYriytPYMhQ@mail.gmail.com> (raw)
In-Reply-To: <CAHYJk3TADwQqfYShHTfTc5MmQLAyToMtKgNMGSPWBcbpSsjg6Q@mail.gmail.com>

On Thu, Jan 25, 2018 at 11:21 PM, Mikael Magnusson <mikachu@gmail.com> wrote:
> On Thu, Jan 25, 2018 at 9:24 PM, Oliver Kiddle <okiddle@yahoo.co.uk> wrote:
>> Daniel Shahaf wrote:
>>> «rsync -4 -6 --<TAB>» does nothing and prints nothing.
>>
>> 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.
>>
>> I'm not especially keen on producing error messages from completion.
>
> For most other commands you get
> % zsh --aoentuh<tab>
> ---- no match for: `script file', `directory', or `option'
>
> And it's also sort of surprising that _complete_help does nothing at all.

You only get the "no match for: ..." text if you have set the
appropriate zstyle.

However, the lack of both help and description is directly connected
to what Oliver was explaining.  Because all possible sets of
completions are excluded, _arguments never calls _description and
there is nothing for _main_complete to report as the context.

How about this?

BartMAC2014% zstyle ':completion:*:messages' format %S%d%s
BartMAC2014% rsync -4 -6 --
no valid completions

It may have other unintended side-effects, though.

diff --git a/Completion/Base/Utility/_arguments
b/Completion/Base/Utility/_arguments
index 136dd58..7b2bd40 100644
--- a/Completion/Base/Utility/_arguments
+++ b/Completion/Base/Utility/_arguments
@@ -583,5 +583,6 @@ if (( $# )) && comparguments -i "$autod"
"$singopt[@]" "$@"; then

   [[ nm -ne "$compstate[nmatches]" ]]
 else
+  _message "no valid completions"
   return 1
 fi


  reply	other threads:[~2018-01-28  2:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-25 15:50 Daniel Shahaf
2018-01-25 20:24 ` Oliver Kiddle
2018-01-26  7:21   ` Mikael Magnusson
2018-01-28  2:16     ` Bart Schaefer [this message]
2018-01-28 21:16       ` Oliver Kiddle
2018-01-25 20:35 ` 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='CAH+w=7YaRQAgdHzUE-YF+XZoLobiT=gynoY9imuUYriytPYMhQ@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=mikachu@gmail.com \
    --cc=zsh-users@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).