aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2016-05-03 19:42:18 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-05-03 19:42:18 +0000
commit275c334042945a257097ce4a981c3f462a4b5f14 (patch)
tree31d756de4e636cca46d2de870e0b3aef100052f1
parent317031cb0035803f54c21cc78ea7cf830a247865 (diff)
parente40f505ad88d42655973f34c27efd562df9de7a8 (diff)
downloadplatform_sdk-275c334042945a257097ce4a981c3f462a4b5f14.tar.gz
platform_sdk-275c334042945a257097ce4a981c3f462a4b5f14.tar.bz2
platform_sdk-275c334042945a257097ce4a981c3f462a4b5f14.zip
Merge "adb completion: call _init_completion if available" am: 1fa245bca1
am: e40f505ad8 * commit 'e40f505ad88d42655973f34c27efd562df9de7a8': adb completion: call _init_completion if available Change-Id: I1ebab46aa2d804c37eefafbda8cc9c46235d8e00
-rw-r--r--bash_completion/adb.bash9
1 files changed, 5 insertions, 4 deletions
diff --git a/bash_completion/adb.bash b/bash_completion/adb.bash
index 4b10e14fc..3017bfa2e 100644
--- a/bash_completion/adb.bash
+++ b/bash_completion/adb.bash
@@ -16,13 +16,14 @@
#
_adb() {
- unset -v have
- type $1 &> /dev/null && have="yes"
-
- if [ "$have" != "yes" ]; then
+ if ! type -t "$1" >/dev/null; then
return
fi
+ if type -t _init_completion >/dev/null; then
+ _init_completion || return
+ fi
+
local where i cur serial
COMPREPLY=()