This was cherry-picked from the gomod branch instead of being merged as
a PR for two reasons:
1) The vhost plugin addition isn't yet ready for merging, as there's
a lot of code duplication.
2) This code can technically be merged as is without the mods to the
vhost plugin.
When/If we're ready to merge the vhost plugin we'll fix that side up.
Removed a stack of unnecessary temp vars and reduced the code size.
Removed superfluous error vars. Added the 'z' flag for "No progress".
Fixed up the 'help' command (it was broken thanks to the way the
mandatory flags were being set for the global options). Fixed up a case
where the error message was being shown twice after option parsing.