Usage: ===== emacs -Q --batch --load ernie.el -f ernie/main \ -- [] [ ...] (For an easier time, see the "Examples" subsection below for how to use the provided wrappers.) Options: ======= --abspath By default the file name is prefixed to the matching lines of text as a relative path. This option will prefix absolute paths instead. --A N --after-context N Print the N lines that come immediately after the match. This option takes precedence over the --context option. --B N --before-context N Print the N lines that come immediately before the match. This option takes precedence over the --context option. --C N --context N Print the N lines that come immediately before the match and the N lines to come immediatly after the match. This option is overridden by the --after-context and --before-context options. -c --count Print the count of the number of matches found. Do not print any matching lines. -e --regexp Set the regular expression. This option can be used more than once to express alternation. If and only if this option is not set explicitly, the first positional parameter is used as the regular expression. --exclude Any file matching the regular expression is excluded. This option can be used more than once to express alternation. By default, no files are excluded. -F --fixed-strings Treat the search pattern as a fixed string instead of as a regular expression. -h --no-filename By default, when matching multiple files, the output lines are prefixed with the name of the file that contains the matching line. This option prevents the file name from being printed. -H --with-filename By default, when matching a single file, the output lines are not prefixed with the name of the file that contains the matching line. This option enables the file name to be printed. --help Print the help message and exit. -i --ignore-case Perform a case-insensitive search. --include Only files matching the regular expression are included. This option can be used more than once to express alternation. By default all files are included. --line-length-limit Truncate each matching line to characters. By default or if size is 0, there is no limit on the line length. The length can be specified in characters or with a suffix of "K", "M", or "G" to indicate kilo-characters, mega-characters, or giga-characters respectively. Lower-case suffix letters are also valid. -n --line-number Prefix the matching line with the line number. -r -R --recursive Recursively grep directories. By default, directories are ignored and not part of the grep. --size-limit Limit the files that are grepped to those that are less than the specified size. By default or if size is 0, there is no limit on the file size. Size can be specified in bytes or with a suffix of "K", "M", or "G" to indicate kilobytes, megabytes, or gigabytes respectively. Lower-case suffix letters are also valid. -v --invert-match Only print lines that do not match. -V --version Print the version and exit. For the "ernie" wrapper, you need to provide a dummy regular expression (to match with the implicit trailing -e option): ernie - -V -w --word-regexp To match, the substring must start and end on a word boundary. Examples: ======== 1) # Use "--help" to get help, not "-h"! emacs -Q --batch -L `pwd` --load ernie.el -f ernie/main -- --help 2) # Make sure you remember the "--" to separate options. # Make sure you remember the "-r" to recursively search. emacs -Q --batch -L `pwd` --load ernie.el -f ernie/main \ -- -r -n -i -e foo . 3) # On Unix, you can use the "grep.sh" wrapper to simplify. ./grep.sh -r -n -i -e foo . 4) # On Windows, you can use the "grep.bat" wrapper to simplify. .\grep.bat -r -n -i -e foo . 5) # Both commands above can be shorted using the "ernie" wrapper. ernie foo .