Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5f51464 authored by Jeff Vander Stoep's avatar Jeff Vander Stoep
Browse files

envsetup: add tomlgrep and jsongrep

This is useful for searching Rust config files in external.

Test: cd external/rust/crates; tomlgrep foo
Change-Id: I1ff5118a8eee1a95f1bc6fa44c922673a03ebd8b
parent 951f8c31
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ Invoke ". build/envsetup.sh" from your shell to add the following functions to y
- ggrep:      Greps on all local Gradle files.
- gogrep:     Greps on all local Go files.
- jgrep:      Greps on all local Java files.
- jsongrep:   Greps on all local Json files.
- ktgrep:     Greps on all local Kotlin files.
- resgrep:    Greps on all local res/*.xml files.
- mangrep:    Greps on all local AndroidManifest.xml files.
@@ -87,6 +88,7 @@ Invoke ". build/envsetup.sh" from your shell to add the following functions to y
- rsgrep:     Greps on all local Rust files.
- sepgrep:    Greps on all local sepolicy files.
- sgrep:      Greps on all local source files.
- tomlgrep:   Greps on all local Toml files.
- pygrep:     Greps on all local Python files.
- godir:      Go to the directory containing a file.
- allmod:     List all modules.
@@ -1236,6 +1238,18 @@ function rsgrep()
        -exec grep --color -n "$@" {} +
}

function jsongrep()
{
    find . -name .repo -prune -o -name .git -prune -o -name out -prune -o -type f -name "*\.json" \
        -exec grep --color -n "$@" {} +
}

function tomlgrep()
{
    find . -name .repo -prune -o -name .git -prune -o -name out -prune -o -type f -name "*\.toml" \
        -exec grep --color -n "$@" {} +
}

function ktgrep()
{
    find . -name .repo -prune -o -name .git -prune -o -name out -prune -o -type f -name "*\.kt" \