Description
Improve zsh completion script generation.
There are many issues with script generation. Some of them are documented in #679 & its comments.
This issue is for a first batch of zsh completion script fixes.
I will submit a PR. Each commit should note the fix(es) that it contains.
If you want documentation of the fixes directly in the GitHub issue and/or PR without having to look at the commit messages, I can include info from the commit messages here and/or in the PR description.
If you want the PR for this split up, parts removed or changed, etc., please let me know, and I'll make the requisite changes.
After this PR is merged, I will sequentially create an issue & submit a PR each for initial bash & fish fixes, then one or more PRs for cross-shell changes, then I will resume working on more fixes.