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 27620 invoked from network); 12 May 2021 15:51:33 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 12 May 2021 15:51:33 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1620834693; b=YjuVF6pSXHs1B4wxofi8SBZf+Fm4qT2HpYx9ka5CAstrE2Z/IknDi6XKmoxj96AN/5clShBrmH eVHFtTSM5g4kubXxb0rCsdtLOzVhXR7CsG8YJlLyYCfrEv1iJTEK5QJws1IL0Yy4itRH223iEL 5Td7bIdva9w53g9WHzXmTP8n9rH36XQEfMa/VIo1XZo/qTSxpryXaq358PwedFTdmlss61+yLY 1fmdPaekntPfO4wKft/xd0oJ45BoFIzfO8BSc6kiM+eQYkK8Pcl/Q3+FGr4ane8leKw3wHT9dU EHAK9oPJOoVIkndNcuOA++cfuFs/lGfiLVFUscvNd1CFVA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ot1-f50.google.com) smtp.remote-ip=209.85.210.50; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 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-20200801; t=1620834693; bh=tKuIONgsdGPWYhqGhjCRmvc6VQYYMA7Kji0YJt24uXQ=; 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=lBnGCJfoOssY/e4HKFg3KbNAy3YGovtoKaK8k8jwbvDU27bSerHhlSUajSHKAlSA0q2b4GWdPZ KPL1E5Pzl9oa/UwZphaqnw6AlpO0cEaZxEmpRxmCPHaNAIw8ER6QVTS+4zvfv+LYxtZ5lkmzlk KpEst+U5tX7HOxJNJFmZ2s9QW0BQ+dk1msfyI3l3l4K+MZ6hx5ip0ulzuz9mc28eJ1VcWnh1j6 OvzbwtM+WIcWiYhYDubpn+RmHkUyPo+8fKTgydhM/vEeRkHgDz1zrbeQG1pYBTTutk41k1sEGX dl6EJanSMJteUQkOd8GHjDZOAkJBTh5RnokoX7EdRe0mCw==; 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=FO9jP8RUawWUcwgiRP+t7SQJak4TXv4SZr+fIa9EHBE=; b=fxftyzYZi6ps4OKVXyZ1Pobcpi GaBOGqZOLbAlNFm+UwuRI4JKGuyDkQen9WP0pAs+3dNdymY7r6mFwHoV8HWGj5nHvso53cmyN/dDW p+jVSlhZz0PB4Ba+WgxPQwxWowoDpqBoeOYIELfdZ5LOb7TytGIw0IPtzG1Hd6JQrhdynX2KpFqyY 8h/1OoFfVbcFoyw9Vk6KxuzgJI61x53WvBRvkODp7/Mm2MJeP2tsvZqpmCCyXoTN5FwiI530BZT5A 8VST1TUIYX7dD121ILFTUOoGaJ9AqPE2LFE/7/09vs+qoEzbNn1Y90zAVBw145/XgDz0eh5sGqjkS r6vf6I/Q==; Received: from authenticated user by zero.zsh.org with local id 1lgr92-0004sh-VO; Wed, 12 May 2021 15:51:32 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ot1-f50.google.com) smtp.remote-ip=209.85.210.50; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ot1-f50.google.com ([209.85.210.50]:46600) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1lgr7v-00048g-8M; Wed, 12 May 2021 15:50:23 +0000 Received: by mail-ot1-f50.google.com with SMTP id d3-20020a9d29030000b029027e8019067fso20910544otb.13 for ; Wed, 12 May 2021 08:50:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FO9jP8RUawWUcwgiRP+t7SQJak4TXv4SZr+fIa9EHBE=; b=ibBot0CNLD0KNvx6hDpMQ68UtHhdhSJoNJyteeJoDtQoaMv9UFKiySBoVfvOwE1yzt Ru5XE3fsd/FWhyHaRnmAUFMTtZFeg2B2VJoONtrQtCRteFlnfRCHWDmLW9jhUB6roaBN CrDJVcMKw7JU3APSiaVyu0DwlxqEoBIlAMctVvASxVtHkeMV9HMWquCdj9OqJf/kfQEv hBa88z7yoETM/ZIuTG4+isKll+PNOE2xRtRqbC8uuFYoWtjsboPVix+0vXLru9xk4o2d q7AyYmEhKNsQDTXsQYlPOgJxIrsUVnkwaocpgSKiAJzrd8GKHjckzWIG9u8l6xLudFyU FGxA== 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=FO9jP8RUawWUcwgiRP+t7SQJak4TXv4SZr+fIa9EHBE=; b=dohXmfC9RKwbZDI0zkXaN3Aw0kYtbiqZ4w4BvzJnpub3KIUbwsMUjKrDxBTcx/Fc5I 4Yf8bJNYiWXu/zolQcBE6+Clzqc+HPCYO75vCYb9hf943bCTJlQb5caa78uUV5sfD+Ja ztDtwQpZJaly1UG/fjKL+ucYrv4cfGtYuEBG+cF6EBH4Sz9bX3VmVandPScj/kZQ8izd uVc+vdAHnYW+Rrt8qV6hbFXf0mcQacBQSXm2/KDdcZbe1THIE2dlsePDF/IuRNYFRXFN mcqfo7/1Q84dzpQBhcHXz9vMWbB/tHqozdyJJ2m0chWO/YFhLbK0jlQtb3bPJmzuyBKy 7mCw== X-Gm-Message-State: AOAM533gLfi0DappHg/pKNHbUwcj3PniwR7ghNLr1lW8JymvEo9ovJMF /0jGyvKBqQIfn1eZ9P12P6bRll6N6QUBtXe/GKDJXw== X-Google-Smtp-Source: ABdhPJx17WXFeR7XQJ1CS5uMdyPfajAXDL4lrbnKNCF4h67GzMrF+PHPxptHcwjW5mdfNcgUA1+11831GLmepXz7eQQ= X-Received: by 2002:a9d:170b:: with SMTP id i11mr26042096ota.161.1620834622088; Wed, 12 May 2021 08:50:22 -0700 (PDT) MIME-Version: 1.0 References: <27484ec7-fc56-4164-b9b6-edfb62df0514@www.fastmail.com> In-Reply-To: From: Bart Schaefer Date: Wed, 12 May 2021 08:50:10 -0700 Message-ID: Subject: Re: How to complete with _arguments() depending on an option and within a loop To: Philippe Proulx Cc: Daniel Shahaf , Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 26728 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 8:15 AM Philippe Proulx wrote: > > I believe the complexity of Zsh completion can translate into better > command line UX. Certainly. > Why would _argument() support not repeating an option (the default) > then (`--opt[my option]` vs `*--opt[my option]`)? It's a degrees-of-effort thing. There's a (subjective) point at which the effort to limit the completion results to exactly what "makes sense" in a given context, exceeds the benefit of doing so. I think that a lot of the time the benefit is given so much weight that the effort becomes unreasonable. Completion shouldn't offer nonsense (like the \"\"\" result in another recent thread, that's clearly a bug) but it's rarely going to achieve perfection. Returning to your specific question, you might look at using _regex_arguments instead. If you can figure out the syntax, you can put almost unlimited effort into making the result perfect.