android : add autocomplete for emulators.
This commit is contained in:
parent
944e651b7d
commit
e6654e66ab
|
@ -3,8 +3,14 @@
|
||||||
# Usage: emulator [NAME]
|
# Usage: emulator [NAME]
|
||||||
function emulator() {
|
function emulator() {
|
||||||
local name="${1}"
|
local name="${1}"
|
||||||
|
|
||||||
[[ "${name}" = "" ]] && name="default"
|
[[ "${name}" = "" ]] && name="default"
|
||||||
|
|
||||||
${ANDROID_SDK_ROOT}/emulator/emulator -avd "${name}" &> /dev/null & disown
|
${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
|
||||||
|
|
Reference in a new issue