android : add autocomplete for emulators.

This commit is contained in:
Dmitry Voronin 2023-12-13 22:21:09 +03:00
parent 944e651b7d
commit e6654e66ab

View file

@ -3,8 +3,14 @@
# Usage: emulator [NAME]
function emulator() {
local name="${1}"
[[ "${name}" = "" ]] && name="default"
${ANDROID_SDK_ROOT}/emulator/emulator -avd "${name}" &> /dev/null & disown
}
function _android_emulators() {
_autocomplete_first $(ls --classify .android/avd/ | grep \/$ | sed -e "s/.avd\/$//")
}
complete -F _android_emulators emulator