[PATCH] etc: completion: Filter gratuitous spaces from available packages.

DoneSubmitted by Liliana Marie Prikler.
Details
2 participants
  • Liliana Marie Prikler
  • Tobias Geerinckx-Rice
Owner
unassigned
Severity
normal
L
L
Liliana Marie Prikler wrote on 24 Oct 14:09 +0200
(address . guix-patches@gnu.org)
c0d4144fd32fbb11b7b057438dd9342f375b232c.camel@gmail.com
* etc/completion/zsh/_guix (_guix_list_available_packages): Add a sed filterto remove spaces.--- etc/completion/zsh/_guix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Toggle diff (15 lines)diff --git a/etc/completion/zsh/_guix b/etc/completion/zsh/_guixindex bbc13c6ca1..6b4060ddeb 100644--- a/etc/completion/zsh/_guix+++ b/etc/completion/zsh/_guix@@ -57,7 +57,7 @@ _guix_list_available_packages() { if ( [[ ${+_guix_available_packages} -eq 0 ]] || _cache_invalid GUIX_AVAILABLE_PACKAGES ) \ && ! _retrieve_cache GUIX_AVAILABLE_PACKAGES; then- _guix_available_packages=(${${(f)"$(guix package -A | cut -f1)"}})+ _guix_available_packages=(${${(f)"$(guix package -A | cut -f1 | sed -e 's/ //g')"}}) _store_cache GUIX_AVAILABLE_PACKAGES _guix_available_packages fi }-- 2.33.1
T
T
Tobias Geerinckx-Rice wrote on 24 Oct 15:43 +0200
(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
87zgqyilg5.fsf@nckx
Liliana Marie Prikler 写道:
Toggle quote (3 lines)> + _guix_available_packages=(${${(f)"$(guix package -A | > cut -f1 | sed -e 's/ //g')"}})
Does ZSH support something like bash's "${foo[@]// /}"" to avoid spawning sed altogether?
Otherwise LGTM!
Kind regards,
T G-R
-----BEGIN PGP SIGNATURE-----
iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCYXVj6g0cbWVAdG9iaWFzLmdyAAoJEA2w/4hPVW15NDEA/1M7ewpJ7+Hs6ynrEcLfhoNUu9FzpO35lxzsgqhYBusIAQDNGqZ8qj98ONPQZ/CKT/MMi751+ukcKxwIiULpGMVpCQ===gjjw-----END PGP SIGNATURE-----
T
T
Tobias Geerinckx-Rice wrote on 24 Oct 15:57 +0200
87wnm2ikxm.fsf@nckx
Tobias Geerinckx-Rice via Guix-patches via 写道:
Toggle quote (3 lines)> Does ZSH support something like bash's "${foo[@]// /}"" to avoid> spawning sed altogether?
It *seems* equivalent, which is as much as I dare say of anything ZSH.
Kind regards,
T G-R
-----BEGIN PGP SIGNATURE-----
iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCYXVmhQ0cbWVAdG9iaWFzLmdyAAoJEA2w/4hPVW15DssA/RXWvIDwTHtgbTsjVfmDY6PDnnC5Mvwl1jmeRJ2M0QjIAP4iKxUye73B1CEPpDV5nSkYaKeWeoQUV70zcHJhl2ZuCw===D0D/-----END PGP SIGNATURE-----
L
L
Liliana Marie Prikler wrote on 24 Oct 16:47 +0200
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)(address . 51373@debbugs.gnu.org)
344a41f281c0abaec9533f0b683c9b3bde16ffa9.camel@gmail.com
Am Sonntag, den 24.10.2021, 15:57 +0200 schrieb Tobias Geerinckx-Rice:
Toggle quote (6 lines)> Tobias Geerinckx-Rice via Guix-patches via 写道:> > Does ZSH support something like bash's "${foo[@]// /}"" to avoid> > spawning sed altogether?> > It *seems* equivalent, which is as much as I dare say of anything > ZSH.
Haha, yeah, zsh can be weird at times. I typically don't play aroundwith such fancy syntax all that much so on the top of my head Iwouldn't even know how to rewrite my patch using that. However, if ithelps not spawning a process like once during compinit, then go aheadand use your version :)
Thanks,Liliana
T
T
Tobias Geerinckx-Rice wrote on 24 Oct 21:01 +0200
(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)(address . 51373-done@debbugs.gnu.org)
87wnm29rdz.fsf@nckx
Liliana Marie Prikler 写道:
Toggle quote (4 lines)> Haha, yeah, zsh can be weird at times. I typically don't play > around> with such fancy syntax all that much so on the top of my head I
Your sanity is duly envied.
Toggle quote (6 lines)> wouldn't even know how to rewrite my patch using that. However, > if it> helps not spawning a process like once during compinit, then go > ahead> and use your version :)
There are plenty of other seds littering the file—though not this trivial. At least commit 55f6d9e818512b4e3e4adacfa99deb201b6854be avoids one more.
Thanks!
T G-R
-----BEGIN PGP SIGNATURE-----
iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCYXWuGQ0cbWVAdG9iaWFzLmdyAAoJEA2w/4hPVW155QEBANbrHjSl77G1JUjePovJF+DfiaOxnoEETtrq6yja3SAkAP9/1UYcBnbyjNeLPf6+orxnJ9sZCNryG2E0Fb5EePh8CA===EjcE-----END PGP SIGNATURE-----
Closed
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send email to 51373@debbugs.gnu.org