Update bash_completion to not use a temp file
TEST=Tested within chroot and using "repo start ooga b<tab>"
Change-Id: I372d13458fb89571db4cdd7561e91c68e1563941
Review URL: http://codereview.chromium.org/3191012
diff --git a/bash_completion b/bash_completion
index 6a3077c..bc9988a 100644
--- a/bash_completion
+++ b/bash_completion
@@ -200,10 +200,9 @@
_list_repo_projects() {
local repo=${COMP_WORDS[0]}
- local manifest=$(mktemp)
- "$repo" manifest -o "$manifest" >& /dev/null
- grep 'project name=' "$manifest" | sed 's/.\+name="\([^"]\+\)".\+/\1/'
- rm -f "$manifest" >& /dev/null
+ "$repo" manifest -o /dev/stdout 2> /dev/null \
+ | grep 'project name=' \
+ | sed 's/.\+name="\([^"]\+\)".\+/\1/'
}
# Complete repo's <command> argument.