From b6558fd9ed6c89ffc0d5a643f303e8b9ca33895a Mon Sep 17 00:00:00 2001 From: Varun Gandhi Date: Wed, 9 Sep 2020 13:42:31 -0700 Subject: [PATCH] [docs] Describe using `git grep` in FAQ. Also changed the grep example to use long flag names for clarity. --- docs/HowToGuides/FAQ.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/HowToGuides/FAQ.md b/docs/HowToGuides/FAQ.md index 51cd6d0596a..5a54c1c8cf3 100644 --- a/docs/HowToGuides/FAQ.md +++ b/docs/HowToGuides/FAQ.md @@ -64,8 +64,14 @@ This very depends on what X is, but some broad guidelines are: 1. Do a case-insensitive recursive string search. - Use a specialized tool like [ripgrep](https://github.com/BurntSushi/ripgrep) or [ag](https://github.com/ggreer/the_silver_searcher). + - Use `git grep --ignore-case "mypattern"`. `git grep` also supports helpful + flags which provide more context: + - `--show-function`: Tries to print the function name that a match was + found in. + - `--function-context`: Tries to print the entire surrounding function + containing the match. - Use 'Find in Workspace' in Xcode (++F). - - Use `grep -i -r "mypattern" .`. + - Use `grep --ignore-case --recursive "mypattern" .`. 2. Go through the [Documentation Index](/docs/README.md). ### How do I build the documentation as HTML?