Reviewers: Yang,

Message:
This has been bugging me for a long time; finally got around to fixing it. PTAL.

Description:
Make tools/bash-completion.sh robust against arbitrary CWD

Please review this at https://codereview.chromium.org/168983006/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+2, -2 lines):
  M tools/bash-completion.sh


Index: tools/bash-completion.sh
diff --git a/tools/bash-completion.sh b/tools/bash-completion.sh
index 9f65c677317536ae284b29f362e6aa5fce4b88fd..6e324246d69d4bf844154ad95a8ff70060a9371f 100755
--- a/tools/bash-completion.sh
+++ b/tools/bash-completion.sh
@@ -37,7 +37,7 @@ v8_source=$(readlink -f $(dirname $BASH_SOURCE)/..)
 _v8_flag() {
   local cur defines targets
   cur="${COMP_WORDS[COMP_CWORD]}"
-  defines=$(cat src/flag-definitions.h \
+  defines=$(cat $v8_source/src/flag-definitions.h \
     | grep "^DEFINE" \
     | grep -v "DEFINE_implication" \
     | sed -e 's/_/-/g')
@@ -45,7 +45,7 @@ _v8_flag() {
     | sed -ne 's/^DEFINE-[^(]*(\([^,]*\).*/--\1/p'; \
     echo "$defines" \
     | sed -ne 's/^DEFINE-bool(\([^,]*\).*/--no\1/p'; \
-    cat src/d8.cc \
+    cat $v8_source/src/d8.cc \
     | grep "strcmp(argv\[i\]" \
     | sed -ne 's/^[^"]*"--\([^"]*\)".*/--\1/p')
   COMPREPLY=($(compgen -W "$targets" -- "$cur"))


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to