gnodet opened a new pull request, #1559:
URL: https://github.com/apache/maven-mvnd/pull/1559
## Summary
- Add zsh support to the existing `mvnd-bash-completion.bash` script
(auto-detects shell type)
- Accept `zsh` as valid `--completion` argument in `Completion.java`
- Update README.adoc with zsh instructions
Supersedes #1514 by consolidating the zsh compatibility into the single
existing script rather than adding a separate file. This avoids duplication and
maintenance burden.
## Approach
The script auto-detects bash vs zsh and adapts three shell-specific
behaviors:
- `function_exists`: uses `typeset -f` (zsh) vs `declare -F` (bash)
- Plugin variable discovery: uses `typeset +` (zsh) vs `compgen -v` (bash)
- Indirect variable expansion: uses `${(P)var}` (zsh) vs `${!var}` (bash)
For zsh, `bashcompinit` is loaded to provide bash-style completion builtins
(`complete`, `compgen`, `COMPREPLY`). No global shell options (`setopt`) are
modified.
## Credit
Based on the approach from #1514 by @janweinschenker.
## Test plan
- [x] Full build passes
- [x] Completion template regeneration via `CompletionGeneratorTest` succeeds
- Source the script in bash: works as before
- Source the script in zsh: completions work via bashcompinit layer
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]