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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23304 invoked from network); 12 May 2021 15:16:47 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 12 May 2021 15:16:47 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1620832607; b=AER9BtBbljTGfjAX5Vav6xrmKJ++zBfsnqctjPHwPit80YgEafJJ3HYENcfDt463WrXuuOrqXs dGCyrZgCDYb03zho5o4nesfacELuohwO3b7wDIBy2xG56xs0j9Enc/ZALhGmC1OqXdVcqM8TMo aM13qBH9d5u9tkmI8t/5UuXfOujOwyrjqQXYqiCiBjIhfK5WQen7TZcV5CCftPxxWVZMSdHiI4 3wsYlZGAx0DWc4h3UcH46/zbQMgCyOHGMfq2zpVS2WMjky8LFqEoZ0uQQwYUr6GdFDt3EqKBRq QJmq8uR3gVJO/SN/BU/bm0mL6mhKZcnB121h1kfKh97cgw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yb1-f169.google.com) smtp.remote-ip=209.85.219.169; dkim=pass header.d=gmail.com header.s=20161025 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-20200801; t=1620832607; bh=RmyIxSkW2Ntezfm67Kh+fQSa+JzUOw5B22+6MaXaQmk=; 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=shqzJVKKO9YBmgb2ipnCenigC92F7uaTM+5euAr1140VQkmGE90HgEOZMRW0yBaAIT1y2UaVYG w8bcUcwY8Vlu3NcyXn1N3l34NhL9Y06DTvWQ6kv4X3aXcygJIwzYzX/EnRj5RF1Cu7bsbrHlpK Hx/oVNlQupUIGaBIUsJtLN9POBFtYzXHcrWTefDWkmBMM6hrSkD3Kb+Jxk3SO6nHHVNu4MG9mE YOdDDPPlZGDf2+eErKq80jnr7YX+ifbMgNaXoWFQiJAj+UIrWF8sUtlAQY3+487GU6O+qe4sh9 Q4hBuRVi4/POFIslPpliKx6mzvnYejA4DB/6xnJdjj4G9g==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; 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=Mm3dAwhYazrIMNDpe9XostX/Ag/c90zSZkIJNJhrRwg=; b=uMW/63DSLmQtt2MAiRM5rKGfIt cGsGHcBeidi5HYk2FxA3ClyeDm086IYHRbS+ClDsAJAdSjvWjYx6iNAOdy+CXvje2o+PlEPKfCoPQ 0uR1dTTDbLe+DTOuBS0Yieslr914FUiZMot3ISfTLuJ34Pn6wFXdX+SvdWMBEU8WuzTRmucV9AwNP Mf7gR3YR0cT4xldYmahGYGVdK+TwCfLfi54HB/OZmjxmBH+ENkID/Nf6ST7DsMSW7gxrVwMO8plks epWkH3lpWHmKC0jxC5/0JcZkCyPlKbPhgK+frQf331xZMDO25dTTnvhAHLf4GMdxSBsNvA77j9tvy LqoHB41Q==; Received: from authenticated user by zero.zsh.org with local id 1lgqbP-0002uu-1S; Wed, 12 May 2021 15:16:47 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yb1-f169.google.com) smtp.remote-ip=209.85.219.169; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-yb1-f169.google.com ([209.85.219.169]:36814) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1lgqa7-0002Aq-6g; Wed, 12 May 2021 15:15:27 +0000 Received: by mail-yb1-f169.google.com with SMTP id m9so31192173ybm.3 for ; Wed, 12 May 2021 08:15:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Mm3dAwhYazrIMNDpe9XostX/Ag/c90zSZkIJNJhrRwg=; b=bGfRJSRil2a68r1Bs44ZtFR4ltPdrnAiXps/D12wokK+o8PUFWTe/DHmQFVrUPJ43W GU7bVpc9WD3NdrOcXzvoW+jNbPlrWEWmQNZQcrnrdZqyf6NeBBP+0trNFC9CHJWhXxX6 9XgBspnSvGezRY6HgVv89UFo1qh6RJUsJHOJ3GYf/iHJWGpTlSl8ymEBQUBm/x/u18gT 6tZxVB7jg/DCtYX03PuRUL8oO4iPdsTaI/I0S0nD8sO8/P27FxDhc1G2MERskk24Y0ca 8VFle6yLUMgliY4Ff9Y5HCq2bkttJO3UAnM/XG+MTh5Gnkhu+8nNT83CmdPbKcTrEmxq odww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Mm3dAwhYazrIMNDpe9XostX/Ag/c90zSZkIJNJhrRwg=; b=sGBpOuyyoMMbnyQY2khmYSrQykRpv99ifAN6rVhedxD6VFkuGoswU/Fp0Ph9Ev6vgo 80yfXqWUE23TsGPvdPSKjNReUr1ovHLAZBto11+/01ltOIpJD5aUVQAlDSwi7slW0Oeh KIdiGWIplVDwn+jusGduW+u6iFHu1pkh2Jg/LhtJmw1uxUs2uqaJWV3+3+x6z0m2RSNb tL/3BPtxttwr+2JrYdh2wq9D1CBs7EjFBz7sHLPLmKzv8sbSPZhtQ/1ZWm1Bldf5W3p3 Inr0++niBJn69RJqHN1VO0U14o4bisZfYRNXdBCZMH5pK3dDijqz+fNOfIGl9q4VQVt4 pmFA== X-Gm-Message-State: AOAM5328RikQE4VQCanXllwnZUgW3Ad9GKNUjJNCQDBkXGvOfBVB+aVq CwWChLLL0RXF4oJtwgUhrpLbQEJDjMQyE1esnpho6e5BlL459g== X-Google-Smtp-Source: ABdhPJxX51PHuYY8ernZctAQQhr7RDLUQb0/iXOP3p4NfOTzinK0gDheTXvlaV7h+8P7Y0i3YFhmMw+rvUNpDRNkeSM= X-Received: by 2002:a25:10d6:: with SMTP id 205mr30799018ybq.83.1620832526285; Wed, 12 May 2021 08:15:26 -0700 (PDT) MIME-Version: 1.0 References: <27484ec7-fc56-4164-b9b6-edfb62df0514@www.fastmail.com> In-Reply-To: From: Philippe Proulx Date: Wed, 12 May 2021 11:14:59 -0400 Message-ID: Subject: Re: How to complete with _arguments() depending on an option and within a loop To: Bart Schaefer Cc: Daniel Shahaf , Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 26727 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Wed, May 12, 2021 at 11:11 AM Bart Schaefer wrote: > > On Wed, May 12, 2021 at 6:44 AM Philippe Proulx wrote: > > > > $ beep --device --new > > > > Zsh offers `--device` again, because the completion script "saw" the > > `--new` word, without taking any parsing into account. > > What everybody seems to forget about completion is that it's supposed > to save the user typing time, not save the user from thinkos. If the > user is uncomprehending enough to select --device twice just because > completion offered it, it's not our job to come to the rescue. You'd love Bash then! I believe the complexity of Zsh completion can translate into better command line UX. Why would _argument() support not repeating an option (the default) then (`--opt[my option]` vs `*--opt[my option]`)? Phil