From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 9518 invoked from network); 21 Jul 2022 04:18:48 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 21 Jul 2022 04:18:48 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1658377128; b=IoBImBbOmCr2ncwhxCo67Kgk+aE1WP52fofApjPkh3T3ekIyiagBEF9RgU1Xl8RnM5nk+itTt5 qp9HmsPz4tMG4UwuwB9ZCKTsOZD4DNTq9ctqDYdDMzSmOWbiqPbBCp7q+3bvkcURH3rVeiSdJy SYbYrPMZNwg85C5MQoKOYZKqCN7cgD0+wzCMgP6k4FbAU4ypXuU7jEkircTgnUuSOsRUqSjIuz IrJ2lbmyFK0EikuCqYB4FlU1J4E9/eilfxu1QmJKO6vcUetbLP9hfG+dwRY2g9x1MokV2T3Feb 78yuEiOhq4PEPpNB8LrQdf8t3YP7OARY4tRmr5wdqFpa1A==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lf1-f44.google.com) smtp.remote-ip=209.85.167.44; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1658377128; bh=EPHc2w5dPiA9M/55wp0FK7Fi46UBqZIdP5FVX8Aldws=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:MIME-Version: DKIM-Signature:DKIM-Signature; b=GusrXeVihdZTWmATPnN3p9kdizxGu7t1CB/I/qAZ1eS7dKwn9pIek2J6lt/H23HG8T/j44Da0t cBKFoaUdE+htHzfSzO2Vd6M2t48MdETjUVnkyXqrcx0ENT0vKhzz6ViWz7ZtyGYojXUNkRSqmC g/hrmHpHIi9gXFVbrfccE55ukN2yIBnHv13h9wIgstUZwdA0MTspuavLZpXh896d2oxMyq0Uhu qG3Mj3DhBhbhbVG1ekplXN4e59dJVtf1T36QvnVbYDqfi+M/uTNH0x9EHeY8sp173ZwEA15m1+ eECT2iasEXfl4lxUrdKIVf4XR/5Zlg7WXXykS74JnV0opA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:To:Subject:Message-ID: Date:From:MIME-Version:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=agnAb/jh+qdlZQsYTraSDJ/SXGDoqpqlXVwvjgmx8Mk=; b=OXpWQMf62JgbbsgoGN06cDg/O0 6FrK6b2A/0oMeVdgmkKMXuaTPmhVzbX39yV2F3EJvhc/zULE/eJ4yCqzbwCJhc+dswekObeloqN/V 4LdJjEZxy4GxzolvU1i/iqCU6DEZ4gAsmXZncMENV9adczxuO/uVVA5ATx/9Pq3jdAOmOaJct89ct Hd4xVoFaZUE0H89jax223M1Hwl2GYUx+NHYkM9z8jwWtIEEyowyDF/6Ej2S/VaRu5m5tiw74koX8l PgckXjFhDSUrkeZqilOtJs2PXyRc6uwR+wI6lgyj22+2AAFQWdyCn5JjO9nySJqqBv5oAw9VrWag9 MTJQrg/w==; Received: from authenticated user by zero.zsh.org with local id 1oENeA-000JAg-Hu; Thu, 21 Jul 2022 04:18:46 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lf1-f44.google.com) smtp.remote-ip=209.85.167.44; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lf1-f44.google.com ([209.85.167.44]:41965) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1oENdo-000Iqi-T2; Thu, 21 Jul 2022 04:18:26 +0000 Received: by mail-lf1-f44.google.com with SMTP id t1so904968lft.8 for ; Wed, 20 Jul 2022 21:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=agnAb/jh+qdlZQsYTraSDJ/SXGDoqpqlXVwvjgmx8Mk=; b=Tk6P2LtbyPhiPuwO2q/okd6WPSV8CQxUezsU1hzhMySPCLN6yy+XDrTgpC5vP4EiMS ReYU4EnTKwkVq0PblFwjtnf5IQn+J+BJcrQ9TrrcAn3MKqmp0fgyZ3fVmrgZBE+UtWV9 LHPP2XwPx8FE4xpS7XjeUymTGygrFK2ViUcR56/wHSsS4fTRsY1KjB9sv8CfdS3zXuDn 30rtKk1yaDO5HNilDytjAG9cyQwVOaIbDesSDhfK67D80oEyAR8kFdqRV8ZhFM/Ssfbn ZzaUA9g4iPuRRdEASHu81r1m2qM90ohy02YZtg8u+hET5gOv8QD25LDcmPh4u4ilqOBx 1hkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=agnAb/jh+qdlZQsYTraSDJ/SXGDoqpqlXVwvjgmx8Mk=; b=XCSZQZeeMP2DgS3Tdp+2d1WJDsda4yntNnBFFOdb+4uvGicLHQS67zmDlKTmXgs0DM NAybR2kYUXfo5hE2m6Bj3JaMXzGtjafZ3puWjWxmjl1e7rMANBtL/PLCHEnZCGWsryz0 tw5t+vQuNFPpcCV1WFeuYZCcOvuGH+en92UVcPzmYEGFKBehUNi7HmXp6zXSzjLmnLrf 2coHYGRoNh4FOrPfn86HWMAyo/Usl2t0QyPsMHuuDvASVMn/tL7ErRGRlBzIou5HAPe3 u9jgIW89KEfs9RrTG9UL7pYgDLh3Gu7Vpdn1pz8pECIe0JDf4wB5SP1uhfb3kRQwlSLQ 1xLA== X-Gm-Message-State: AJIora9Bsl3kZcJzM3SnPMH/rFyFpg949PnagPti9tA18en51cENg5u/ dc74pyqfrF/ejrrLM/aJDlY3+wTgu2G5hFgMFYlE3Pif+ko= X-Google-Smtp-Source: AGRyM1tRyj3oo/pVOUV8LWjDGVE9rnMPL6x88Pc2n8t3EO5vG4eFM2kxdrw1EInG8OQDTWMdqoZRdtTe8pcY1ZNlM9w= X-Received: by 2002:a05:6512:3d1d:b0:489:e0d9:c13c with SMTP id d29-20020a0565123d1d00b00489e0d9c13cmr21175360lfv.497.1658377103808; Wed, 20 Jul 2022 21:18:23 -0700 (PDT) MIME-Version: 1.0 From: Pavol Juhas Date: Wed, 20 Jul 2022 21:18:12 -0700 Message-ID: Subject: bug-or-feature - different completion context after "--option VALUE" vs "--option=VALUE" To: zsh-workers@zsh.org Content-Type: multipart/alternative; boundary="0000000000002d1ea605e449024d" X-Seq: 50417 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: --0000000000002d1ea605e449024d Content-Type: text/plain; charset="UTF-8" Hello, I am trying to write a completion function for my custom command, which should offer different suggestions for positional arguments after a long option with mandatory value. I have a code which works as desired when the option is given in "--option VALUE" format, but not if specified as "--option=VALUE". In the latter case the completion is the same as without any option. Here is a reduced minimum example for a command "mycmd" (for testing purpose mycmd can be a symlink to /bin/true): # _mycmd --------------------------------------------------------------------- #compdef mycmd _arguments : \ - name \ '--name=[name of a person]:person-name:()' \ '1:letters:(a b c)' \ - without-name \ '*:digits:(1 2 3)' \ ; # ---------------------------------------------------------------------------- The desired behavior is that command lines starting as either "mycmd --name Alice " and "mycmd --name=Alice " should offer argument suggestions a, b, c, however the version with the equal sign completes 1, 2, 3, as if completing without the --name option. The completion context appears to be incorrect in that case (_ marks cursor position): $ mycmd --name Alice _ tags in context :completion::complete:mycmd:: name-argument-1 (_arguments _mycmd) versus $ mycmd --name=Alice _ tags in context :completion::complete:mycmd:: without-name-argument-rest (_arguments _mycmd) Is this a bug or feature? If feature, am I perhaps missing some special specification flag to make it work? Thank you, Pavol --0000000000002d1ea605e449024d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hel= lo,

<= div class=3D"gmail_default" style=3D"font-size:small">I am trying to write = a completion function for my custom command,
which should offer different suggestions for = positional arguments
after a long option with mandatory value.=C2=A0 I have a code which w= orks as desired
when the option is given in "--option VALUE" format, but not if = specified
as &q= uot;--option=3DVALUE".=C2=A0 In the latter case the completion=C2=A0
is the same as w= ithout any option.

Here i= s a reduced minimum example for a command "mycmd"
(for testing purpose mycmd can= be a symlink to /bin/true):

# _mycmd ---------------= ------------------------------------------------------

<= br>

#compdef mycmd

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0

_arguments : \

=C2=A0 =C2=A0 - name \

=C2=A0 =C2=A0 '--name=3D[name of a= person]:person-name:()' \

=C2=A0 =C2=A0 '1:letters:(a b c)&#= 39; \

=C2=A0 =C2=A0 - without-name= \

=C2=A0 =C2=A0 '*:digits:(1 2 3)= 9; \

=C2=A0 =C2=A0 ;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0

# ----------------------= ------------------------------------------------------


The desired behavior is that command = lines starting as either
"mycmd -= -name Alice "=C2=A0 and=C2=A0 "mycmd --name=3DAlice "=
should offer argument suggestions a, b, c,
however the version with the equal sign= completes 1, 2, 3,
as if completing w= ithout the --name option.
The completion context a= ppears to be incorrect in that case (_ marks cursor position):
=

$ mycmd --name Alice _

tags in context :completion::complete:mycmd::

<= span class=3D"gmail-Apple-converted-space">=C2=A0 =C2=A0 name-argume= nt-1=C2=A0 (_arguments _= mycmd)


versus

$ mycmd --n= ame=3DAlice _

tags in context :completion::complet= e:mycmd::

=C2=A0 =C2=A0 without-name-argument-rest=C2=A0 (_arguments _mycmd)



Is this a bug or feature?
If feature, am I perhaps missing some special specification flag to make= it work?

<= /div>
Thank you,

Pavol

--0000000000002d1ea605e449024d--