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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12995 invoked from network); 21 Jul 2022 22:39:55 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 21 Jul 2022 22:39:55 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1658443195; b=TmHxUZB+FYrJuWJBvxsNvj0F2AM3U0GJtJPw3UQARNa8bXEATk+EK7t+NTYmX9nZ525Ipl2tb4 p41j6uqZ+p7T2oYsvK9hSPuXkpaMy2xzLIFUjIq8BjkiaOqUXN6oRgrLgcY6XH5IB/S3nCtd+b JteURl4RasWi8jjWBOIqfo7TxOSKuHAVCDSzDTWZkxijGQxCZJn5nVxUTUu4cfvlK2dg5sqyAt ROcjfmIsxzMJpK/w1zq+J/URJxF8ZcfRlPRy8XiXmIJwK1ItjFjw7VTjFO7MX/Pm/th71B6ntQ pYP5xtoPzD+JCg252OJNHsr1ulWsUX1Om4jLlTNOydXMmw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f47.google.com) smtp.remote-ip=209.85.208.47; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1658443195; bh=2RDHYtQTMrKC2VuabpukEFvWIT37YOTdS+sYMvBdW7M=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=lDvigvw7K+8UEk8diwQDTYulfnnDKzDzLBUQFPkgbp9nA3jiuGsLhqySUxILlpZFrIlnzXtM2d MWO+2c9vkJEyXa1vloErwEI8hgl6pIP+14cvZL2boUsdHYf7AiX7YfnFe2e9HrOjQ51MIlBefV W0c6E00VtzZJJYaHpJo8xNEBbZwb2Oy6VoeJMsBifMos8IqvQmjcES7j6r4fR2/txFbd5ivoRU DH7YExzmZMSSK90UtsGxhHDZTjc5imx7flmxAMU9amqKGAEbtjqnE2mchjhPSnebIf36C+8Ief +yLHY93QZfrbUyQJWnWM3VFRA+9lFvW8c+QGhg36FW7BsA==; 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:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=bsuBxyPPj28Z9su2OspvHVSpoR2RfU31F1wW4X1PH5g=; b=lIst6bHwfVD1E4rqbpq1k9V/YQ 8cDlmZCL8/GzAihPrgRZsYGyocdCoQdiAkw2JkEAtbq0ffNGbrDJDg+6TCiovfO7SKYDwbNIQi+KV gEtq2KCz97cNd0NlriSn8vaj1QXSRPU8dtx3ZPbz+gDyMxpuxTcVyMhsbDNQTxgcRTGMjldqJbWy2 9PcUBxPyLjcdH9A5eTu8C6G2q6AUEINOKT1rq5fvNi4SXuHKd+/2eaFMzIQwxI+DyAYys9CaWxTfg M2MKKtU5qqP0XnntaPP95+jPkUtpQMPo70qcweKTMKcJfNK7OmlJbpXI9MEzxHYIEfzXI5mOC0AlP xi8X5QzA==; Received: from authenticated user by zero.zsh.org with local id 1oEepm-000Le8-PA; Thu, 21 Jul 2022 22:39:54 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f47.google.com) smtp.remote-ip=209.85.208.47; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ed1-f47.google.com ([209.85.208.47]:39687) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1oEekf-000LCu-EG; Thu, 21 Jul 2022 22:34:38 +0000 Received: by mail-ed1-f47.google.com with SMTP id z22so3891167edd.6 for ; Thu, 21 Jul 2022 15:34:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bsuBxyPPj28Z9su2OspvHVSpoR2RfU31F1wW4X1PH5g=; b=tpsGesgGXq9Um4XTIriZPRr0XwHd3Uob5Tf/uZIMnC1OjZNxqR0kFBD0VuoVlGVd+1 dMWUYUHXQEQ1yg4iaRwOExBIp2qxUdoDdMEyt6QWxvRQmUtmDlSiETIYxt9XCwxlaXMc fI8pKA4Gkuk7+YatfmwHY9o7f/tOUGHB/nhtlL8GHFtiG3ySVFZrvvHND/WosmwfU796 R4W/Y5hD9kTiVH80OmDRDC+nyc3ZVSgubGQ3MsUhFODnC2pk2VRPyZJigmOA9F/jiy8f Daz5e69e0My8hRaXC/20dYl2gt/MZY5dp77jxsq7BqCLxuBJ8cVZi+IpE9usQv2oA2BX lrGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bsuBxyPPj28Z9su2OspvHVSpoR2RfU31F1wW4X1PH5g=; b=1eOoIqZVYl5eUEiPrvsNucODqTvfymWJROC2XxOBOCtduei5Vuc5+O7JiSTD2v3iSZ 8b7nBnbDmiJ67wujjNuaFVlSbFRHbyv0WGcSCLS9pOyjcELkcllYw+ZR/CIc3mRJ9hMI ku1jP8FZ/MafdvKT/zFtiHz6Rjc1MoSNAqjPfDHlCOwNcLmdv3YMgeWwXO+GwknNebSL ypw+201I1v5A+3XHpXL4k//CEI4NHBB8G5zYaGiuEQJ2XBij894TYltFFZtLces6EMOH 0E9N5Kd57pTiPO3VoKEZ02k+5Qo/c9R4v+/HFupujWczPQiTORJN/cXkRN+n9bFixlGv aGgg== X-Gm-Message-State: AJIora/bm2wbmPccGAhmwJIT0CbP09cIo9PfcDAxlfgmP6gdack8fx8l 28V3jlDa7WtKeaIcr85Wp4myNBPEBu92eHGEsMf02A== X-Google-Smtp-Source: AGRyM1v6u3yROKz3I5F/7T2RQOikq7L1u6C+jv5nSJ/EkEwRPZQl01md9x6FGMI7++/C90jbNXuUCE2yCHBavT9qQik= X-Received: by 2002:a05:6402:350a:b0:43a:a486:102e with SMTP id b10-20020a056402350a00b0043aa486102emr602783edd.372.1658442876898; Thu, 21 Jul 2022 15:34:36 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Thu, 21 Jul 2022 15:34:25 -0700 Message-ID: Subject: Re: bug-or-feature - different completion context after "--option VALUE" vs "--option=VALUE" To: Pavol Juhas Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 50420 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: On Wed, Jul 20, 2022 at 9:19 PM Pavol Juhas wrote: > > _arguments : \ > - name \ > '--name=[name of a person]:person-name:()' \ > '1:letters:(a b c)' \ > - without-name \ > '*:digits:(1 2 3)' \ > ; The "sets of arguments" notation has always been a bit tricky. Oliver may have some insight here. I think the problem is that because the without-name set has ONLY a catch-all, it is always the preferred context, that is, when parsing the command line to see which set is present, the without-name set is always chosen. The sets aren't necessarily matched and made mutually exclusive in the order they appear. I would suggest instead that you use the explicit exclusion notation: _arguments : \ '(*)--name=[name of a person]:person-name' \ '1:letters:(a b c)' \ '*:digits:(1 2 3)' Something interesting is going on when you append ':()' to the --name spec, and I don't know if that's intentional on your part. What that says, if I read things correctly, is that the mandatory argument to --name can be the empty string, which effectively makes it an optional argument, so there are some puzzling side-effects. I've dropped ':()' from my example to avoid that.