feat: cleanup .local/bin

This commit is contained in:
ange 2024-10-22 16:33:50 +07:00
parent 757b759b4a
commit 87d37712dd
Signed by: ange
GPG key ID: 9E0C4157BB7BEB1D
21 changed files with 69 additions and 86 deletions

View file

@ -0,0 +1,14 @@
function _ddev() {
# limited to 100 images
for i in {1..5}; do
URL="https://hub.docker.com/v2/repositories/library/?page=$i&page_size=100"
mapfile -t res < <(compgen -W \
"$(curl -sfL "$URL" | jq -r '.results[].name')" \
-- "${COMP_WORDS[1]}")
if [ -z "${res[0]}" ]; then
break
fi
COMPREPLY+=("${res[@]}")
done
}
complete -F _ddev ddev