From 78a2b92d4409c6a9099f8a92cd5c89d2592ddfe2 Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Thu, 15 Nov 2018 14:53:34 +0330 Subject: readme update --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index b240803..304af3a 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ make ## Usage A simple usage example:
```bash -cgrep --func --var --regex n[aA]m ./cgrep.cpp +cgrep -A 1 -B 1 --func --var --regex n[aA]m ./cgrep.cpp ``` Pleade do note that the regex will pass through both C++ and the regex engine, so if you would want to escape `\`, the regex you pass as the commandline arg would be `\\\\` instead of the normal `\\`.
In order for cgrep to work, you need to have a compilation database, tools like cmake can generate one for you.
@@ -26,9 +26,14 @@ Here's an option list though it might not be necessarily up-to-date.
For an up-to-date list, you can run `crep --help`.
```bash + -A= - same as grep, how many lines after the matched line to print + -B= - same as grep, howm many lines before the matched line to print -all - turns on all switches other than nameddecl -awk - outputs location in a gawk freidnly format + -call - match function calls only -class - match class declrations only + -cxxcall - match member function calls only + -declrefexpr - matches declrefexpr -dir= - recursively goes through all the files and directories. assumes compilation databases are present for all source files. -func - match functions only -header - match headers in header inclusions @@ -41,7 +46,6 @@ For an up-to-date list, you can run `crep --help`.
-struct - match structures only -syshdr - match identifiers in system header as well -union - match unions only - -var - map variables only - + -var - match variables only ``` `cgrep` is a clang tool, so it will accecpt all valid clang commandline options.
-- cgit v1.2.3