explitly set --output=label when calling bazel query.
When using BLAZE_COMPLETION_USE_QUERY=true and if users changed the default in
their bazelrc to have a different output (eg. --output=build), the bazel query
output won't be in the correct format and completion doesn't work.
PiperOrigin-RevId: 237005163
diff --git a/scripts/bazel-complete-template.bash b/scripts/bazel-complete-template.bash
index f709386..7b62ec4 100644
--- a/scripts/bazel-complete-template.bash
+++ b/scripts/bazel-complete-template.bash
@@ -210,7 +210,7 @@
if _bazel_completion_use_query; then
package_name=$(echo "$package_name" | tr -d "'\"") # remove quotes
result=$(${BAZEL} --output_base=/tmp/${BAZEL}-completion-$USER query \
- --keep_going --noshow_progress \
+ --keep_going --noshow_progress --output=label \
"kind('$pattern rule', '$package_name:*')" 2>/dev/null |
cut -f2 -d: | "grep" "^$rule_prefix")
else