Add zsh completion script
Fixes #163
--
MOS_MIGRATED_REVID=95542929
diff --git a/site/docs/install.md b/site/docs/install.md
index f4aefd4..38f2447 100644
--- a/site/docs/install.md
+++ b/site/docs/install.md
@@ -134,7 +134,7 @@
You can also add this command to your `~/.bashrc` file.
-## Getting bash completion
+### Getting bash completion
Bazel comes with a bash completion script. To install it:
@@ -145,4 +145,25 @@
you and simply insert `source /path/to/bazel-complete.bash` in your
`~/.bashrc` file (under OS X, put it in your `~/.bash_profile` file).
+### Getting zsh completion
+
+Bazel also comes with a zsh completion script. To install it:
+
+1. Add this script to a directory on your $fpath:
+
+ ```
+ fpath[1,0]=~/.zsh/completion/
+ mkdir -p ~/.zsh/completion/
+ cp scripts/zsh_completion/_bazel ~/.zsh/completion
+ ```
+
+2. Optionally, add the following to your .zshrc.
+
+ ```
+ # This way the completion script does not have to parse Bazel's options
+ # repeatedly. The directory in cache-path must be created manually.
+ zstyle ':completion:*' use-cache on
+ zstyle ':completion:*' cache-path ~/.zsh/cache
+ ```
+
For more information, see [Getting started](getting-started.html).