heroku/hk — pull request #116 by bgentry (2014-03-07 21:19:12+00:00)
Title: Add some early zsh completion

Add zsh tab completion script to `contrib/`. Currently, it completes:

* subcommands (`hk `)
* help arguments (`hk help `)
* the `-a ` flag on most commands that need it
* region names for `hk create -r `

Here are some samples:

![](http://cl.ly/image/212d273o132l/data)

![](http://cl.ly/image/3H1C0E1d0b0d/data)

![](http://cl.ly/image/2E0y093g441M/data)

Most of the commands do not yet have complete options, but this is definitely a start. Ultimately I'd like to lean on hk itself more for this, either like npm does (see the [shell](https://github.com/npm/npm/blob/master/lib/utils/completion.sh) and [javascript](https://github.com/npm/npm/blob/master/lib/completion.js)) or by having a special hk command that outputs some more parsable command listings (to allow each command to be completed automatically rather than having a separate function for each).

The npm approach has the benefit that the tool and its completion script get upgraded together, and makes it less likely for issues w/ version mismatches.