在/etc/bash_completion.d/bazel
中有注释:
454 # Some users have aliases such as bt="bazel test" or bb="bazel build", this
455 # completion function allows them to have auto-completion for these aliases.
456 _bazel__complete_target_stdout() {
例如,这如何用于自动完成bb="bazel build"
?
答案 0 :(得分:-1)
我的解决方案是将此内容附加到/etc/bash_completion.d/bazel
中:
_my_bb_alias_autocomplete() {
_bazel__complete_target_stdout "build"
}
complete -F _my_bb_alias_autocomplete -o nospace bb