ocp-grep - Locates instances of a given OCaml ident in source files, handling (local) opens, module, etc.
ocp-grep [--color=WHEN] [--regexp-strings] [--strings] [OPTION]⦠ID [FILES]â¦
FILES
Files or directories to search into. By default, searches for project root
ID (required)
Fully qualified ident to search for (eg. ‘List.map', ‘Set.Make.add', ...), or string with option ‘-s'.
-c WHEN, --color=WHEN
Colorize the output. WHEN is either ‘always', ‘never' or ‘auto'.
-e, --regexp-strings
Like ‘--strings', but search a POSIX regular expression.
-s, --strings
Search strings within strings in the source, instead of searching code
--help[=FMT] (default=auto)
Show this help in format FMT. The value FMT must be one of auto, pager, groff or plain. With auto, the format is pager or plain whenever the TERM env var is dumb or undefined.
--version
Show version information.
ocp-grep exits with the following status:
|
0 |
on success. |
|||
|
123 |
on indiscriminate errors reported on standard error. |
|||
|
124 |
on command line parsing errors. |
|||
|
125 |
on unexpected internal errors (bugs). |
Current version doesn't handle shadowing and different kinds of idents, therefore you can get false positive if a type and a value have the name.
Field records don't currently respect the distributive ‘{Module.' syntax. Also, if you use record disambiguation, you're on your own for field names since this program doesn't know about typing.