From bce74975d055529cbd186782e2fd99e6da840460 Mon Sep 17 00:00:00 2001 From: Frank Louwers Date: Wed, 28 May 2014 13:57:25 +0200 Subject: [PATCH] =?UTF-8?q?drop=20the=20foreach,=20make=20it=20even=20shor?= =?UTF-8?q?ter.=20thanks=20Marc=20Cornell=C3=A0!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/pj/pj.plugin.zsh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/pj/pj.plugin.zsh b/plugins/pj/pj.plugin.zsh index dac561189..f9cbddf1a 100644 --- a/plugins/pj/pj.plugin.zsh +++ b/plugins/pj/pj.plugin.zsh @@ -41,11 +41,8 @@ alias pjo="pj open" function _pj () { # might be possible to improve this using glob, without the basename trick typeset -a projects - foreach i ($PROJECT_PATHS/*) - do - projects+=(${i##*/}) - done - + projects=($PROJECT_PATHS/*) + projects=$projects:t _arguments '*:file:($projects)' }