Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Minor tweak for _module completion
- X-seq: zsh-users 13161
- From: Daniel Qarras <dqarras@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Minor tweak for _module completion
- Date: Sat, 30 Aug 2008 03:58:11 -0700 (PDT)
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=Jm83Csp61d+kkZuo0X5GUQfPrKfQeL7R8fanBTEWK75d/neR6YDaUy18p9xj8G9sd3XVx4Fr0AVpSwZ/DjemhWmZMhsjQClQ+k7Xpagv/+1HLHMyH0GMct6UsbFzqVfuFfpdG31FRGJHjV86JodDG+fZXNRYPLaKLl1H5F7145Q=;
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
Hi,
the attached patch hides backup files (ending with ~, often created unknowingly with emacs by many users) while completing for "module".
(I presume it was ok to use "grep -E" instead of two grep commands, ie, "grep -E" should be supported where zsh can be used? If not, please feel free to modify if needed.)
Thanks!
--- zsh/Completion/Unix/Command/_module.orig
+++ zsh/Completion/Unix/Command/_module
@@ -85,7 +85,7 @@
{
if [[ -n $MODULEPATH ]] && [[ ${+_available_modules} -eq 0 ]]
then
- _available_modules=($(find ${(e)=MODULEPATH//:/ } -xtype f -print 2>/dev/null | grep -v \.version | sed -e 's,\('${${(e)=MODULEPATH//:/\/\\\|}%\\\|}'\),,g' -e 's,^/*,,g'))
+ _available_modules=($(find ${(e)=MODULEPATH//:/ } -xtype f -print 2>/dev/null | grep -E -v '(\.version|\~$)' | sed -e 's,\('${${(e)=MODULEPATH//:/\/\\\|}%\\\|}'\),,g' -e 's,^/*,,g'))
fi
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author