Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3024ba1 authored by Jim Tang's avatar Jim Tang Committed by android-build-merger
Browse files

Merge "Adb and fastboot completion supports zsh users."

am: 74be24d6

Change-Id: I9cc9fdfe875479eb1f6aa2fce7b896fd9d656630
parents 2fec0c6a 74be24d6
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -16,11 +16,11 @@
#

_adb() {
    if ! type -t "$1" >/dev/null; then
    if ! check_type "$1" >/dev/null; then
        return
    fi

    if type -t _init_completion >/dev/null; then
    if check_type _init_completion >/dev/null; then
        _init_completion || return
    fi

@@ -435,7 +435,7 @@ _adb_util_list_files() {
    fi

    # Since we're probably doing file completion here, don't add a space after.
    if [[ $(type -t compopt) = "builtin" ]]; then
    if [[ $(check_type compopt) == "builtin" ]]; then
        compopt -o nospace
    fi

@@ -451,7 +451,7 @@ _adb_util_complete_local_file()
    xspec=$2

    # Since we're probably doing file completion here, don't add a space after.
    if [[ $(type -t compopt) = "builtin" ]]; then
    if [[ $(check_type compopt) == "builtin" ]]; then
        compopt -o plusdirs
        if [[ "${xspec}" == "" ]]; then
            COMPREPLY=( ${COMPREPLY[@]:-} $(compgen -f -- "${cur}") )
@@ -492,7 +492,7 @@ _adb_util_complete_local_file()
}


if [[ $(type -t compopt) = "builtin" ]]; then
if [[ $(check_type compopt) == "builtin" ]]; then
    complete -F _adb adb
else
    complete -o nospace -F _adb adb
+4 −4
Original line number Diff line number Diff line
@@ -16,11 +16,11 @@
#

_fastboot() {
    if ! type -t "$1" >/dev/null; then
    if ! check_type "$1" >/dev/null; then
        return
    fi

    if type -t _init_completion >/dev/null; then
    if check_type _init_completion >/dev/null; then
        _init_completion || return
    fi

@@ -135,7 +135,7 @@ _fastboot_util_complete_local_file() {
    xspec=$2

    # Since we're probably doing file completion here, don't add a space after.
    if [[ $(type -t compopt) = "builtin" ]]; then
    if [[ $(check_type compopt) == "builtin" ]]; then
        compopt -o plusdirs
        if [[ "${xspec}" == "" ]]; then
            COMPREPLY=( ${COMPREPLY[@]:-} $(compgen -f -- "${cur}") )
@@ -175,7 +175,7 @@ _fastboot_util_complete_local_file() {
    fi
}

if [[ $(type -t compopt) = "builtin" ]]; then
if [[ $(check_type compopt) == "builtin" ]]; then
    complete -F _fastboot fastboot
else
    complete -o nospace -F _fastboot fastboot