Speed up zsh target completion
authorBen Falconer <ben@falconers.me.uk>
Fri, 30 Oct 2015 14:43:32 +0000 (14:43 +0000)
committerBen Falconer <ben@falconers.me.uk>
Fri, 30 Oct 2015 14:43:32 +0000 (14:43 +0000)
misc/zsh-completion

index fd9b3a7..ad7b87f 100644 (file)
@@ -23,8 +23,7 @@ __get_targets() {
     eval dir="${opt_args[-C]}"
   fi
   targets_command="ninja -C \"${dir}\" -t targets"
-  eval ${targets_command} 2>/dev/null | while read -r a b; do echo $a | cut -d ':' -f1; done;
-
+  eval ${targets_command} 2>/dev/null | sed "s/^\(.*\): .*$/\1/"
 }
 
 __get_tools() {