From 9180a07b8fb33d5ba0b82facf987b51ca7b15dc4 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 13 Apr 2021 14:57:40 -0400 Subject: command: make --verbose/--quiet available to all subcommands Add new CommonOptions entry points to move the existing --jobs to, and relocate all --verbose/--quiet options to that. This provides both a consistent interface for users as well as for code. Change-Id: Ifaf83b88872421f4749b073c472b4a67ca6c0437 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/303224 Reviewed-by: Raman Tenneti Tested-by: Mike Frysinger --- subcmds/grep.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'subcmds/grep.py') diff --git a/subcmds/grep.py b/subcmds/grep.py index 49feaf6b..9a4a8a36 100644 --- a/subcmds/grep.py +++ b/subcmds/grep.py @@ -82,8 +82,11 @@ contain a line that matches both expressions: if value is not None: pt.append(value) + def _CommonOptions(self, p): + """Override common options slightly.""" + super()._CommonOptions(p, opt_v=False) + def _Options(self, p): - super()._Options(p) g = p.add_option_group('Sources') g.add_option('--cached', action='callback', callback=self._carry_option, -- cgit v1.2.3-54-g00ecf