Replace the current Zsh completion with a Zsh completion solution based
on Go completions. This allows to support custom completions (based
on Go completions), but also to standardize the behavior of completion
across all shells.
Also, add support to Go completions for the bash completion annotations:
BashCompFilenameExt (including Command.MarkFlagFilename() family)
- still supported by zsh
BashCompSubdirsInDir - now supported by zsh
BashCompOneRequiredFlag (including Command.MarkFlagRequired() family)
- now supported by zsh and fish
Finally, remove the suggestin of the = form of flag completion.
The = form is supported, but it will not be suggested to avoid having
duplicated suggestions.
- Moved some general function to a more generic shell_completions file.
- Added functions to mark flag as directory completion.
- Started making the global functions docs more generic (not bash
specific) and added compatibility matrix.
I thought there was a bug in the boolSlice definition but it seems
It was my mistake in identifying what's going on. Also removed the
provisioning to skip tests (doesn't seem to be needed anymore).
- If the flags are not bool the completion expects argument.
- You don't have to specify file extensions for file completion to
work.
- Allow multiple occurrences of flag if type is stringArray.
Need to verify that these assumption are correct :)
A very basic POC. Need to refactor to generate completion
structure before passing to the template to avoid repeated
computations.
What works:
* Real zsh completion (not built on bash)
* Basic flags (with long flag and optional shorthand)
* Basic filename completion indication (not with file extensions though)
What's missing:
* File extensions to filename completions
* Positional args
* Do we require handling only short flags?