aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2019-10-10 06:06:10 +0000
committerbloodstalker <thabogre@gmail.com>2019-10-10 06:06:10 +0000
commitc6d11d26863089d614160a0ae8eda4f18efe11fd (patch)
tree61445be4188aeb879371e44c94e2de897ffac445
parentupdate (diff)
downloadcgrep-c6d11d26863089d614160a0ae8eda4f18efe11fd.tar.gz
cgrep-c6d11d26863089d614160a0ae8eda4f18efe11fd.zip
readme update
-rw-r--r--README.md48
1 files changed, 26 insertions, 22 deletions
diff --git a/README.md b/README.md
index 111455c..d79dd3e 100644
--- a/README.md
+++ b/README.md
@@ -21,7 +21,6 @@ The makefile assumes clang is called `clang` and llvm-config is called `llvm-con
```bash
make CXX=clang-9.0 LLVM_CONF=llvm-config-9.0
```
-
## Usage
A simple usage example:<br/>
```bash
@@ -33,32 +32,37 @@ If your build tool doesn't do that, you can just use [bear](https://github.com/r
You can also skip the compilation database alltogether passing cgrep `--` after the input file name which means you have chosen not to pass it anything.<br/>
You can pass the options by hand since cgrep is a Clang instance so it recognizes every option clang has.<br/>
+cgrep uses ANSI escape sequences for colors so your terminal should support those.<br/>
+
## Options
Here's an option list though it might not be necessarily up-to-date.<br/>
For an up-to-date list, you can run `crep --help`.<br/>
```bash
- -A=<int> - same as grep, how many lines after the matched line to print
- -B=<int> - 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=<string> - 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
- -macro - match macro definitions
- -mainfile - mathc identifiers in the main file only
- -memfunc - match member functions only
- -memvar - match member variables only
- -nameddecl - matches all named declrations
- -regex=<string> - the regex to match against
- -struct - match structures only
- -syshdr - match identifiers in system header as well
- -union - match unions only
- -var - match variables only
+ -A=<int> - same as grep, how many lines after the matched line to print
+ -B=<int> - 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=<string> - recursively goes through all the files and directories. assumes compilation databases are present for all source files.
+ --extra-arg=<string> - Additional argument to append to the compiler command line
+ --extra-arg-before=<string> - Additional argument to prepend to the compiler command line
+ --func - match functions only
+ --header - match headers in header inclusions
+ --macro - match macro definitions
+ --mainfile - match identifiers in the main file only
+ --memfunc - match member functions only
+ --memvar - match member variables only
+ --nameddecl - matches all named declrations
+ -p=<string> - Build path
+ --regex=<string> - the regex to match against
+ --struct - match structures only
+ --syshdr - match identifiers in system header as well
+ --union - match unions only
+ --var - match variables only
```
`cgrep` is a clang tool, so it will accecpt all valid clang commandline options.<br/>