Add b autocomplete to envsetup
Note that b autocompletion isn't perfect, given that the autocompletion script looks into the workspace root for BUILD files, instead of out/soong/workspace. (Also, out/soong/workspace may not even be available if bp2build has not yet been run!) However, this is a good start to autocompletion, as bazel commands, flags, and packages autocomplete correctly. Fixes: 196945896 Test: Treehugger Test: Manual verification of `b` autocompletion Change-Id: Ia99abcfe50d195c48644c7b3455243c03d5d38f7
This commit is contained in:
@@ -398,6 +398,7 @@ function addcompletions()
|
|||||||
packages/modules/adb/adb.bash
|
packages/modules/adb/adb.bash
|
||||||
system/core/fastboot/fastboot.bash
|
system/core/fastboot/fastboot.bash
|
||||||
tools/asuite/asuite.sh
|
tools/asuite/asuite.sh
|
||||||
|
prebuilts/bazel/common/bazel-complete.bash
|
||||||
)
|
)
|
||||||
# Completion can be disabled selectively to allow users to use non-standard completion.
|
# Completion can be disabled selectively to allow users to use non-standard completion.
|
||||||
# e.g.
|
# e.g.
|
||||||
@@ -419,6 +420,8 @@ function addcompletions()
|
|||||||
if [ -z "$ZSH_VERSION" ]; then
|
if [ -z "$ZSH_VERSION" ]; then
|
||||||
# Doesn't work in zsh.
|
# Doesn't work in zsh.
|
||||||
complete -o nospace -F _croot croot
|
complete -o nospace -F _croot croot
|
||||||
|
# TODO(b/244559459): Support b autocompletion for zsh
|
||||||
|
complete -F _bazel__complete -o nospace b
|
||||||
fi
|
fi
|
||||||
complete -F _lunch lunch
|
complete -F _lunch lunch
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user