FS#76311 - [python-hatch] shell completion is incorrect
Attached to Project:
Community Packages
Opened by Wu Zhenyu (Freed) - Thursday, 27 October 2022, 11:02 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:04 GMT
Opened by Wu Zhenyu (Freed) - Thursday, 27 October 2022, 11:02 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:04 GMT
|
Details
hatch completion script can be generated by:
```sh ❯ _HATCH_COMPLETE=zsh_source hatch #compdef hatch _hatch_completion() { local -a completions local -a completions_with_descriptions local -a response (( ! $+commands[hatch] )) && return 1 response=("${(@f)$(env COMP_WORDS="${words[*]}" COMP_CWORD=$((CURRENT-1)) _HATCH_COMPLETE=zsh_complete hatch)}") for type key descr in ${response}; do if [[ "$type" == "plain" ]]; then if [[ "$descr" == "_" ]]; then completions+=("$key") else completions_with_descriptions+=("$key":"$descr") fi elif [[ "$type" == "dir" ]]; then _path_files -/ elif [[ "$type" == "file" ]]; then _path_files -f fi done if [ -n "$completions_with_descriptions" ]; then _describe -V unsorted completions_with_descriptions -U fi if [ -n "$completions" ]; then compadd -U -V unsorted -a completions fi } compdef _hatch_completion hatch; ``` However, <https://github.com/archlinux/svntogit-community/blob/packages/python-hatch/trunk/hatch_complete.zsh> is not correct. `complete_zsh` should be `zsh_complete`. |
This task depends upon
Closed by Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:04 GMT
Reason for closing: Moved
Additional comments about closing: https://gitlab.archlinux.org/archlinux/p ackaging/packages/python-hatch/issues/1
Saturday, 25 November 2023, 20:04 GMT
Reason for closing: Moved
Additional comments about closing: https://gitlab.archlinux.org/archlinux/p ackaging/packages/python-hatch/issues/1
The above is in line with https://click.palletsprojects.com/en/8.1.x/shell-completion/#enabling-completion
Completion seems to only work after `source /usr/share/zsh/site-functions/_hatch`... -_-