Merge "envsetup: Add pygrep function to grep all python files"
This commit is contained in:
@@ -35,6 +35,7 @@ Invoke ". build/envsetup.sh" from your shell to add the following functions to y
|
|||||||
- rsgrep: Greps on all local Rust files.
|
- rsgrep: Greps on all local Rust files.
|
||||||
- sepgrep: Greps on all local sepolicy files.
|
- sepgrep: Greps on all local sepolicy files.
|
||||||
- sgrep: Greps on all local source files.
|
- sgrep: Greps on all local source files.
|
||||||
|
- pygrep: Greps on all local Python files.
|
||||||
- godir: Go to the directory containing a file.
|
- godir: Go to the directory containing a file.
|
||||||
- allmod: List all modules.
|
- allmod: List all modules.
|
||||||
- gomod: Go to the directory containing a module.
|
- gomod: Go to the directory containing a module.
|
||||||
@@ -1226,6 +1227,12 @@ function rcgrep()
|
|||||||
-exec grep --color -n "$@" {} +
|
-exec grep --color -n "$@" {} +
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function pygrep()
|
||||||
|
{
|
||||||
|
find . -name .repo -prune -o -name .git -prune -o -name out -prune -o -type f -name "*\.py" \
|
||||||
|
-exec grep --color -n "$@" {} +
|
||||||
|
}
|
||||||
|
|
||||||
case `uname -s` in
|
case `uname -s` in
|
||||||
Darwin)
|
Darwin)
|
||||||
function mgrep()
|
function mgrep()
|
||||||
|
Reference in New Issue
Block a user