mirror of
https://github.com/servo/servo.git
synced 2025-06-23 00:24:35 +01:00
Add a './mach grep' command. [Issue #5838]
This commit is contained in:
parent
50eb08bcf7
commit
27943c0ea5
1 changed files with 13 additions and 0 deletions
|
@ -76,3 +76,16 @@ class MachCommands(CommandBase):
|
|||
category='devenv')
|
||||
def rust_root(self):
|
||||
print(self.config["tools"]["rust-root"])
|
||||
|
||||
@Command('grep',
|
||||
description='`git grep` for selected directories.',
|
||||
category='devenv')
|
||||
@CommandArgument(
|
||||
'params', default=None, nargs='...',
|
||||
help="Command-line arguments to be passed through to `git grep`")
|
||||
def grep(self, params):
|
||||
if not params:
|
||||
params = []
|
||||
grep_paths = [path.join(self.context.topdir, 'components'),
|
||||
path.join(self.context.topdir, 'ports')]
|
||||
return subprocess.call(["git"] + ["grep"] + params + ['--'] + grep_paths, env=self.build_env())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue