diff --git a/tools_webrtc/mb/mb.py b/tools_webrtc/mb/mb.py index 8b726bf93b..43b9cb400d 100755 --- a/tools_webrtc/mb/mb.py +++ b/tools_webrtc/mb/mb.py @@ -157,6 +157,9 @@ class MetaBuildWrapper(object): help='look up the command for a given config or ' 'builder') AddCommonOptions(subp) + subp.add_argument('--quiet', default=False, action='store_true', + help='Print out just the arguments, ' + 'do not emulate the output of the gen subcommand.') subp.set_defaults(func=self.CmdLookup) subp = subps.add_parser( @@ -286,12 +289,15 @@ class MetaBuildWrapper(object): def CmdLookup(self): vals = self.Lookup() - cmd = self.GNCmd('gen', '_path_') gn_args = self.GNArgs(vals) - self.Print('\nWriting """\\\n%s""" to _path_/args.gn.\n' % gn_args) - env = None + if self.args.quiet: + self.Print(gn_args, end='') + else: + cmd = self.GNCmd('gen', '_path_') + self.Print('\nWriting """\\\n%s""" to _path_/args.gn.\n' % gn_args) + env = None - self.PrintCmd(cmd, env) + self.PrintCmd(cmd, env) return 0 def CmdRun(self): diff --git a/tools_webrtc/mb/mb_unittest.py b/tools_webrtc/mb/mb_unittest.py index 0e7173abb4..c17800061a 100755 --- a/tools_webrtc/mb/mb_unittest.py +++ b/tools_webrtc/mb/mb_unittest.py @@ -776,6 +776,11 @@ class UnitTest(unittest.TestCase): def test_lookup(self): self.check(['lookup', '-c', 'debug_goma'], ret=0) + def test_quiet_lookup(self): + self.check(['lookup', '-c', 'debug_goma', '--quiet'], ret=0, + out=('is_debug = true\n' + 'use_goma = true\n')) + def test_lookup_goma_dir_expansion(self): self.check(['lookup', '-c', 'rel_bot', '-g', '/foo'], ret=0, out=('\n'