Skip to content

Commit d497477

Browse files
authored
Increase zsh autocompletion compatibilty (#24)
1 parent d0030ef commit d497477

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v0.1.0 (May 2, 2024)
2+
* Increase zsh autocompletion compatibilty.
3+
14
## v0.0.9 (April 4, 2024)
25
* Fixes issue with help command shorthand flag `-h`. [#20] thanks @Masamerc
36

scripts/_awsd_autocomplete

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env bash
12

23
[ "$BASH_VERSION" ] && AWSD_CMD="awsd" || AWSD_CMD="_awsd"
34
_awsd_completion() {
@@ -6,4 +7,12 @@ _awsd_completion() {
67
COMPREPLY=($(compgen -W "$suggestions" -- $cur))
78
return 0
89
}
10+
11+
# complete is a bash builtin, but recent versions of ZSH come with a function
12+
# called bashcompinit that will create a complete in ZSH. If the user is in
13+
# ZSH, load and run bashcompinit before calling the complete function.
14+
if [[ -n ${ZSH_VERSION-} ]]; then
15+
autoload -U +X bashcompinit && bashcompinit
16+
fi
17+
918
complete -o nospace -F _awsd_completion "${AWSD_CMD}"

0 commit comments

Comments
 (0)