bash-completion: use simpler git ls-files command
Equivalent perf, less code.
Review URL: https://chromiumcodereview.appspot.com/9307098
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120439 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/tools/bash-completion b/tools/bash-completion
index 229582c..6a1b89a9 100644
--- a/tools/bash-completion
+++ b/tools/bash-completion
@@ -11,7 +11,7 @@
local cur targets
cur="${COMP_WORDS[COMP_CWORD]}"
targets=$(cd $chrome_source; \
- git ls-files | grep switches | \
+ git ls-files '*switches*' | \
xargs sed -ne 's/^[^/]*"\([^" /]\+\)".*/--\1/p')
COMPREPLY=($(compgen -W "$targets" -- "$cur"))
return 0