I have this partly working, but [there is a Kingpin issue with completing common prefixes](https://github.com/alecthomas/kingpin/pull/106). Still, I'll clean up and commit the mostly-working code, it's useful as-is.