From ae679409e5d0ebf373dd02acdc3d1de4afdfd8c8 Mon Sep 17 00:00:00 2001 From: Udi Oron Date: Sun, 31 Jul 2022 16:20:05 +0300 Subject: [PATCH] Nicer solution to escape zsh completions, refs #382 Thanks to https://unix.stackexchange.com/a/711922/43483 --- bin/completion/zsh/_tldr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/completion/zsh/_tldr b/bin/completion/zsh/_tldr index 41ba993..027e13e 100644 --- a/bin/completion/zsh/_tldr +++ b/bin/completion/zsh/_tldr @@ -1,7 +1,7 @@ #compdef tldr local -a pages oses -pages=$(for cmd in $(tldr -a1); do echo ${(q)cmd}; done) +pages=$(tldr -a1) oses='( linux osx sunos windows )' _arguments \ @@ -22,4 +22,4 @@ _arguments \ '--windows[override operating system with Windows]' \ '(- *)'{-u,--update}'[update local cache]' \ '(- *)'{-c,--clear-cache}'[clear local cache]' \ - "*:page:(${pages})" && return 0 + "*:page:(${(b)pages})" && return 0