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

Commit 31a70ee8 authored by Anton Hansson's avatar Anton Hansson Committed by android-build-merger
Browse files

Merge "Tab completion for the croot function"

am: 5cbb3633

Change-Id: Ia1b45a7a278efba54ce8bf6246d4e9fa8019fee3
parents b568c2e1 5cbb3633
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ Invoke ". build/envsetup.sh" from your shell to add the following functions to y
              build, and stores those selections in the environment to be read by subsequent
              invocations of 'm' etc.
- tapas:      tapas [<App1> <App2> ...] [arm|x86|mips|arm64|x86_64|mips64] [eng|userdebug|user]
- croot:      Changes directory to the top of the tree.
- croot:      Changes directory to the top of the tree, or a subdirectory thereof.
- m:          Makes from the top of the tree.
- mm:         Builds all of the modules in the current directory, but not their dependencies.
- mmm:        Builds all of the modules in the supplied directories, but not their dependencies.
@@ -370,6 +370,10 @@ function addcompletions()
    if should_add_completion bit ; then
        complete -C "bit --tab" bit
    fi
    if [ -z "$ZSH_VERSION" ]; then
        # Doesn't work in zsh.
        complete -o nospace -F _croot croot
    fi
    complete -F _lunch lunch

    complete -F _complete_android_module_names gomod
@@ -985,6 +989,18 @@ function croot()
    fi
}

function _croot()
{
    local T=$(gettop)
    if [ "$T" ]; then
        local cur="${COMP_WORDS[COMP_CWORD]}"
        k=0
        for c in $(compgen -d ${T}/${cur}); do
            COMPREPLY[k++]=${c#${T}/}/
        done
    fi
}

function cproj()
{
    local TOPFILE=build/make/core/envsetup.mk