Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[patch] Useless use of ls



diff --git a/Completion/Linux/Command/_vserver b/Completion/Linux/Command/_vserver
index 2401387..36a61c4 100644
--- a/Completion/Linux/Command/_vserver
+++ b/Completion/Linux/Command/_vserver
@@ -95,7 +95,7 @@ _vserver_cache_cfgdir() {
 _vserver_cache_vsnames() {
   if [[ "$_cache_vserver_vsnames_initialized" != true ]]; then
     typeset -ga _cache_vserver_vsnames
-    _cache_vserver_vsnames=( $(ls -d $_cache_vserver_cfgdir/*/ | sed -e s,$_cache_vserver_cfgdir,, | tr -d '/') )
+    _cache_vserver_vsnames=( $_cache_vserver_cfgdir/*(/:t) )
     _cache_vserver_vsnames_initialized=true
   fi
 }



Messages sorted by: Reverse Date, Date, Thread, Author