diff options
author | Jeff Brown <jeffbrown@google.com> | 2014-07-26 15:15:41 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2014-07-26 15:19:21 -0700 |
commit | 46cbd200988a650be9a595e095af92c045f8f522 (patch) | |
tree | f7a81916e57cb6af673f198074e44dadc42e27bb /envsetup.sh | |
parent | 82af97fc274c27da7099c46f84ad48f6f9624537 (diff) | |
download | build-46cbd200988a650be9a595e095af92c045f8f522.zip build-46cbd200988a650be9a595e095af92c045f8f522.tar.gz build-46cbd200988a650be9a595e095af92c045f8f522.tar.bz2 |
Tweak sgrep to add cc and aidl files.
Also add it to the help list since it was missing.
Change-Id: I11403e63bc421fd146ad88452eac05043eacabc3
Diffstat (limited to 'envsetup.sh')
-rw-r--r-- | envsetup.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/envsetup.sh b/envsetup.sh index 29e4c4c..da7b6b3 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -14,6 +14,7 @@ Invoke ". build/envsetup.sh" from your shell to add the following functions to y - ggrep: Greps on all local Gradle files. - jgrep: Greps on all local Java files. - resgrep: Greps on all local res/*.xml files. +- sgrep: Greps on all local source files. - godir: Go to the directory containing a file. Look at the source to view more functions. The complete list is: @@ -21,7 +22,7 @@ EOF T=$(gettop) local A A="" - for i in `cat $T/build/envsetup.sh | sed -n "/^function /s/function \([a-z_]*\).*/\1/p" | sort`; do + for i in `cat $T/build/envsetup.sh | sed -n "/^[ \t]*function /s/function \([a-z_]*\).*/\1/p" | sort | uniq`; do A="$A $i" done echo $A @@ -1091,14 +1092,14 @@ case `uname -s` in Darwin) function sgrep() { - find -E . -name .repo -prune -o -name .git -prune -o -type f -iregex '.*\.(c|h|cpp|S|java|xml|sh|mk)' -print0 | xargs -0 grep --color -n "$@" + find -E . -name .repo -prune -o -name .git -prune -o -type f -iregex '.*\.(c|h|cc|cpp|S|java|xml|sh|mk|aidl)' -print0 | xargs -0 grep --color -n "$@" } ;; *) function sgrep() { - find . -name .repo -prune -o -name .git -prune -o -type f -iregex '.*\.\(c\|h\|cpp\|S\|java\|xml\|sh\|mk\)' -print0 | xargs -0 grep --color -n "$@" + find . -name .repo -prune -o -name .git -prune -o -type f -iregex '.*\.\(c\|h\|cc\|cpp\|S\|java\|xml\|sh\|mk\|aidl\)' -print0 | xargs -0 grep --color -n "$@" } ;; esac |