From ad545320a78d3c61f42dab14767d05139a871c0a Mon Sep 17 00:00:00 2001
From: Mathias Stearn <redbeard0531@gmail.com>
Date: Thu, 18 May 2017 09:51:31 -0400
Subject: Make zsh completion use explicitly specified ninja files

---
 misc/zsh-completion | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/misc/zsh-completion b/misc/zsh-completion
index 446e269..bf23fac 100644
--- a/misc/zsh-completion
+++ b/misc/zsh-completion
@@ -22,7 +22,12 @@ __get_targets() {
   then
     eval dir="${opt_args[-C]}"
   fi
-  targets_command="ninja -C \"${dir}\" -t targets all"
+  file="build.ninja"
+  if [ -n "${opt_args[-f]}" ];
+  then
+    eval file="${opt_args[-f]}"
+  fi
+  targets_command="ninja -f \"${file}\" -C \"${dir}\" -t targets all"
   eval ${targets_command} 2>/dev/null | cut -d: -f1
 }
 
-- 
cgit v0.12