grep - Grep through files known to bzr

Version 0.4.0
Branch https://launchpad.net/bzr-grep
Owner parthm
GNU/Linux Yes
Windows Yes
Mac OS X Yes

Print lines matching PATTERN for specified files and revisions.

grep

Purpose

Print lines matching PATTERN for specified files and revisions.

Usage

bzr grep PATTERN [PATH...]

Options

--from-root Search for pattern starting from the root of the branch. (implies –recursive)
-n, --line-number
 show 1-based line number.
-F, --fixed-string
 Interpret PATTERN is a single fixed string (not regex).
-v, --verbose Display more information.
--color=WHEN Show match in color. WHEN is never, always or auto.
-Z, --null Write an ASCII NUL (0) separator between output lines rather than a newline.
-h, --help Show help message.
-q, --quiet Only display errors and warnings.
-l, --files-with-matches
 Print only the name of each input file in which PATTERN is found.
-i, --ignore-case
 ignore case distinctions while matching.
--levels=N Number of levels to display - 0 for all, 1 for collapsed (1 is default).
--usage Show usage message and options.
-X GLOB, --exclude=GLOB
 Skip files whose base name matches GLOB.
--no-recursive Don’t recurse into subdirectories. (default is –recursive)
-I GLOB, --include=GLOB
 Search only files whose base name matches GLOB.
-L, --files-without-match
 Print only the name of each input file in which PATTERN is not found.
-r ARG, --revision=ARG
 See “help revisionspec” for details.

Description

This command searches the specified files and revisions for a given pattern. The pattern is specified as a Python regular expressions[1].

If the file name is not specified, the revisions starting with the current directory are searched recursively. If the revision number is not specified, the working copy is searched. To search the last committed revision, use the ‘-r -1’ or ‘-r last:1’ option.

Unversioned files are not searched unless explicitly specified on the command line. Unversioned directores are not searched.

When searching a pattern, the output is shown in the ‘filepath:string’ format. If a revision is explicitly searched, the output is shown as ‘filepath~N:string’, where N is the revision number.

–include and –exclude options can be used to search only (or exclude from search) files with base name matches the specified Unix style GLOB pattern. The GLOB pattern can use *, ?, and [...] as wildcards, and \ to quote wildcard or backslash character literally. Note that the glob pattern is not a regular expression.

[1] http://docs.python.org/library/re.html#regular-expression-syntax

Table Of Contents

Previous topic

debuntu - Shortcuts to Ubuntu and Debian source branches on Launchpad

Next topic

git - Transparent interoperability with Git branches

This Page