/usr/share/bash-completion/completions/adb is in android-tools-adb 5.1.1r36+git20160322-0ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | _adb()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="shell push pull reboot reboot-bootloader forward logcat devices kill-server root remount"
case "$prev" in
shell | pull | reboot-bootloader | logcat | devices | kill-server | root | remount)
COMPREPLY=()
return 0
;;
reboot)
COMPREPLY=( $(compgen -W "bootloader recovery" -- $cur) )
return 0
;;
push)
COMPREPLY=( $(compgen -o default -o plusdirs -f -- $cur) )
return 0
;;
*)
local prev2="${COMP_WORDS[COMP_CWORD-2]}"
if [ "$prev2" == "push" ] || [ "$prev2" == "reboot" ];then
return 0
fi
;;
esac
COMPREPLY=( $(compgen -W "$opts" -- $cur) )
return 0
}
complete -F _adb adb
|