diff options
author | Nico Weber <nicolasweber@gmx.de> | 2014-10-26 20:39:49 (GMT) |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2014-10-26 20:39:49 (GMT) |
commit | b8a6fa07f27f665b1a4dcd0e2bd014a4090f5274 (patch) | |
tree | b223c402668dc7492af99c9faba4624594c6e96f | |
parent | 165b6d189c916ba1a2c19b5b193829b691150a65 (diff) | |
parent | a73e6931aebdc30a66e194e199bc662bf1cea9cb (diff) | |
download | Ninja-b8a6fa07f27f665b1a4dcd0e2bd014a4090f5274.zip Ninja-b8a6fa07f27f665b1a4dcd0e2bd014a4090f5274.tar.gz Ninja-b8a6fa07f27f665b1a4dcd0e2bd014a4090f5274.tar.bz2 |
Merge pull request #834 from frasercrmck/master
Add zsh completion for targets in conjunction with -C
-rw-r--r-- | misc/zsh-completion | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/misc/zsh-completion b/misc/zsh-completion index 2fe16fb..af24f89 100644 --- a/misc/zsh-completion +++ b/misc/zsh-completion @@ -17,7 +17,14 @@ # . path/to/ninja/misc/zsh-completion __get_targets() { - ninja -t targets 2>/dev/null | while read -r a b; do echo $a | cut -d ':' -f1; done; + dir="." + if [ -n "${opt_args[-C]}" ]; + then + 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; + } __get_tools() { |