From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3361 invoked by alias); 4 Jan 2018 16:05:33 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42219 Received: (qmail 1634 invoked by uid 1010); 4 Jan 2018 16:05:33 -0000 X-Qmail-Scanner-Diagnostics: from mail-io0-f196.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.223.196):SA:0(-1.9/5.0):. Processed in 7.289435 secs); 04 Jan 2018 16:05:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: dana@dana.is X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=nYBlTTG0Nm7pKazuSCIcRigY4VOZRQJvdTr3t6WdLms=; b=DayRzK8gEaP25w6AX1G+ZOILGiSq3D9F9TzcrrM9/Kwh966c1yRCximkY+Jtmgek4u aJpEeiyYHHGnVFcXnzkQ47/DlKmjUwKvYKQSGYZcQQ8I2K28PTRUA2fCNj3MNpX1aQuY JSYhja/N/jE4hNzovDqSRDOJKnnQ++q8p5zp+qV3rCUZe+GPxos9WW1g8JwJJKh9jlul /Yhi6XDqeNsuQab6EvieztSANhSCazDWVooUClJf+vIkmh3SMsAhYfVNoEDaUyq0bMBz 7/1d9jWfXMwpSBpTnDgcsoYWVZivG4iYPACIn7xIJU9nWqe6eBcaNHBSJx6VAH02B+Mm 2JBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=nYBlTTG0Nm7pKazuSCIcRigY4VOZRQJvdTr3t6WdLms=; b=qVJiuEDD9LOUPT2xPMdsfnVH8S2ggAlnZBHJefuZM7qAAJ4TjpDK0JLHlNneVI7x4F qtC1hw0G9Wec4/24a5PbMOd60SxrIFRGKpPyiFHDs3FchFj/FzH55wP2dUFsmQZM0j+7 /nr0yOzNJk45YCai09zprGdFzRnG0gb7iN+Se2H/FXXAl749ysvey8rLk8Kiiwxssomk RMdcFu1MqDN4gYUAvBVia/VelkLweBM5Kr8IpAd/BD3GGioXrTOSRJKh+F9zak5qN89m fUjGw3pXFvYky1uKxche7upMZLtlYsK1zaMCuWpoUJjS9p2s6+Th5bR9v/p1F8QJQJrf +h3Q== X-Gm-Message-State: AKwxytdCGn1VmxVHoChRHPEsrDro3O08qCwQDgXbbQ3SpXYDEgxAtgp5 LAtED28VKfJ6VDfak09EEC5Kmw== X-Google-Smtp-Source: ACJfBotKupU/YBtXP/kJJvfO1M823cH3/PV2bz9iQ74WdH5NGST7n+7kRwyxTSco1ojodhH7yKx4Ig== X-Received: by 10.107.11.221 with SMTP id 90mr46696iol.160.1515081923127; Thu, 04 Jan 2018 08:05:23 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [PATCH] Completion batch #2: Misc. trivial fixes From: dana In-Reply-To: <20806.1515066433@thecus.kiddle.eu> Date: Thu, 4 Jan 2018 10:05:19 -0600 Cc: zsh-workers@zsh.org Content-Transfer-Encoding: quoted-printable Message-Id: <0D626F37-219D-49BC-A1CA-31A8F1CABF1E@dana.is> References: <289FC0FD-FDAB-4575-8882-E9F8F3FFE4C5@dana.is> <18174.1515022825@thecus.kiddle.eu> <1C17F1B9-C935-44B0-A8E4-52D87EE76DE6@dana.is> <20806.1515066433@thecus.kiddle.eu> To: Oliver Kiddle X-Mailer: Apple Mail (2.3273) On 4 Jan 2018, at 05:47, Oliver Kiddle wrote: >Given that that works well, I'd go with that solution. It'd be possible >to add an option to _normal/_dispatch. Having them know about >_pick_variant internals is less ugly. It is, however, probably only = worthwhile if >it is going to be used elsewhere. It might be wise to dig around for >other use cases. _builtin is the only thing that comes to mind. That's the only thing i can find that's similar too. As far as use cases = we might develop in the future: I've heard there is a GNU coreutils = multi-call (so you can do like `coreutils expand`), but i've never seen it in the wild. = And there is a BSD-licensed competitor to BusyBox called Toybox, but i've = only ever heard of it being used by Android. On 4 Jan 2018, at 05:47, Oliver Kiddle wrote: >Caching the >result is unlikely to be necessary but if it is, don't use = _cmd_variant. >poweroff likely doesn't get run many times in a single zsh session >anyway. Caching is not necessary in terms of performance =E2=80=94 checking for = file paths like you mentioned is a fast operation. But if i want to complete `busybox = poweroff` using the method discussed it seems like i'll either need to call = _pick_variant or deal with _cmd_variant myself, right? (Or i guess i could have = _busybox pass down some *other* variable, but that seems even messier.) On 4 Jan 2018, at 05:47, Oliver Kiddle wrote: >Doesn't "superfluous" have much the same meaning as "pointless" in this >case. It does indeed >On 4 Jan 2018, at 05:47, Oliver Kiddle wrote: It seems to work as it is but I'd clean it up if making changes for the busybox variant anyway. Doesn't busybox allow expand to be a hard link to busybox to run expand? BusyBox does allow you to link its 'applets', yeah. And in that case of = course _pick_variant will correctly identify a command as BusyBox without any = special cases. But sometimes you have coreutils or whatever for your normal = stuff existing side-by-side with the busybox multi-call for other things. At = least, that was my own use case. I will clean up my _expand change when i submit _busybox. Let me know if = you have any other thoughts in the mean time. Thanks! dana