The cgrep package

[Tags: gpl, program]

Cgrep: a context-aware grep for source codes

[Skip to ReadMe]


Versions6.4, 6.4.1, 6.4.2, 6.4.3,, 6.4.4, 6.4.5, 6.4.6, 6.4.7, 6.4.8, 6.4.9, 6.4.10, 6.4.11, 6.4.12, 6.4.13, 6.4.14, 6.4.15, 6.4.16, 6.4.17, 6.4.18, 6.4.19, 6.4.20, 6.4.21, 6.4.22, 6.5.0, 6.5.1, 6.5.2, 6.5.3, 6.5.4, 6.5.5, 6.5.6, 6.5.7
Change logNone available
Dependenciesansi-terminal (>=0.5), array (>=0.4), base (>=4.5 && <4.8), bytestring (>=0.10), cmdargs (>=0.10), containers (>=0.5), directory (>=1.2), dlist (>=0.3), filepath (>=1.3), ghc-prim (>=0.2), regex-posix (>=0.90), safe (>=0.3), split (>=0.2), stm (>=2.1), stringsearch (>=0.3), unordered-containers (>=0.1) [details]
AuthorNicola Bonelli
MaintainerNicola Bonelli <>
Home page
UploadedSat Jun 21 09:30:50 UTC 2014 by NicolaBonelli
Downloads2929 total (239 in last 30 days)
0 []
StatusDocs not available [build log]
All reported builds failed as of 2015-10-06 [all 3 reports]


Maintainers' corner

For package maintainers and hackage trustees

Readme for cgrep-6.4.3

CGrep: a context-aware grep for source codes


Cgrep 6.4.3 Usage: cgrep [OPTION] [PATTERN] files...

cgrep [OPTIONS] [ITEM]


-f --file=FILE            read PATTERNs from file
-w --word                 force word matching
-p --prefix               force prefix matching
-s --suffix               force suffix matching
-e --edit                 use edit distance
-i --ignore-case          ignore case distinctions
-G --regex                regex matching

Context filters (generic):

-c --code                 enable search in source code
-m --comment              enable search in comments
-l --literal              enable search in string literals

Semantic (generic):

-S --semantic             "code" pattern: _, _1, _2... (identifiers), $,
                          $1, $2... (optionals), ANY, KEY, STR, CHR, NUM,
                          HEX, OCT, OR. -> e.g. "_1(_1 && \$)" search for
                          move constructors, "struct OR class _ { OR : OR <"
                          search for a class declaration

C/C++ language:

   --identifier           identifiers
   --keyword              keywords
   --directive            preprocessing directives
   --header               headers names
   --number               literal numbers
   --string               literal strings
   --char                 literal chars
   --oper                 operators

Output control:

-h --no-filename          suppress the file name prefix on output
-N --no-line-umber        suppress the line number on output lines
   --lang=ITEM            specify languages. ie: Cpp, +Haskell, -Makefile
   --lang-maps            lists the language mappings
   --force-language=ITEM  force the language
-j --jobs=INT             number of jobs
   --multiline=INT        enable multi-line matching
-r --recursive            enable recursive search
-v --invert-match         select non-matching lines
   --max-count=INT        stop search in files after INT matches
   --count                print only a count of matching lines per file
   --show-match           show list of matching tokens
   --color                use colors to highlight the matching strings
   --format=STRING        format output. Var: #f #n #l #t ## #, #; #0 #1...
                          e.g. "#f:#n #0 #1"
   --json                 format output as json object
   --xml                  format output as xml document


-d --debug=INT            debug level: 1, 2 or 3
-n --no-turbo             disable turbo mode
-? --help                 Display help message
-V --version              Print version information