21
21
from bzrlib import errors
22
22
from bzrlib.commands import Command, register_command, display_command
23
from bzrlib.option import (
23
from bzrlib.option import Option, ListOption
27
25
from bzrlib.lazy_import import lazy_import
28
26
lazy_import(globals(), """
73
71
format. If a revision is explicitly searched, the output is shown as
74
72
'filepath~N:string', where N is the revision number.
74
--include and --exclude options can be used to search only (or exclude
75
from search) files with base name matches the specified Unix style GLOB
76
pattern. The GLOB pattern an use *, ?, and [...] as wildcards, and \\
77
to quote wildcard or backslash character literally.
76
79
[1] http://docs.python.org/library/re.html#regular-expression-syntax
96
99
help='Number of levels to display - 0 for all, 1 for collapsed (1 is default).',
98
101
type=_parse_levels),
102
ListOption('include', type=str, argname='glob',
103
help="Search only files whose base name matches GLOB."),
104
ListOption('exclude', type=str, argname='glob',
105
help="Skip files whose base name matches GLOB."),
103
def run(self, verbose=False, ignore_case=False, no_recursive=False, from_root=False,
104
null=False, levels=None, line_number=False, path_list=None, revision=None, pattern=None):
110
def run(self, verbose=False, ignore_case=False, no_recursive=False,
111
from_root=False, null=False, levels=None, line_number=False,
112
path_list=None, revision=None, pattern=None, include=None,
106
115
recursive = not no_recursive