Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: tools/mb/mb.py

Issue 1234343005: Re-land "Update docs and command line flags for MB." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add missing command line argument Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/mb/docs/user_guide.md ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """MB - the Meta-Build wrapper around GYP and GN 6 """MB - the Meta-Build wrapper around GYP and GN
7 7
8 MB is a wrapper script for GYP and GN that can be used to generate build files 8 MB is a wrapper script for GYP and GN that can be used to generate build files
9 for sets of canned configurations and analyze them. 9 for sets of canned configurations and analyze them.
10 """ 10 """
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 subp.add_argument('-f', '--config-file', metavar='PATH', 58 subp.add_argument('-f', '--config-file', metavar='PATH',
59 default=self.default_config, 59 default=self.default_config,
60 help='path to config file ' 60 help='path to config file '
61 '(default is //tools/mb/mb_config.pyl)') 61 '(default is //tools/mb/mb_config.pyl)')
62 subp.add_argument('-g', '--goma-dir', default=self.ExpandUser('~/goma'), 62 subp.add_argument('-g', '--goma-dir', default=self.ExpandUser('~/goma'),
63 help='path to goma directory (default is %(default)s).') 63 help='path to goma directory (default is %(default)s).')
64 subp.add_argument('-n', '--dryrun', action='store_true', 64 subp.add_argument('-n', '--dryrun', action='store_true',
65 help='Do a dry run (i.e., do nothing, just print ' 65 help='Do a dry run (i.e., do nothing, just print '
66 'the commands that will run)') 66 'the commands that will run)')
67 subp.add_argument('-q', '--quiet', action='store_true', 67 subp.add_argument('-q', '--quiet', action='store_true',
68 help='Do not print anything, just return an exit ' 68 help='Do not print anything on success, '
69 'code.') 69 'just return an exit code.')
70 subp.add_argument('-v', '--verbose', action='count', 70 subp.add_argument('-v', '--verbose', action='count',
71 help='verbose logging (may specify multiple times).') 71 help='verbose logging (may specify multiple times).')
72 72
73 parser = argparse.ArgumentParser(prog='mb') 73 parser = argparse.ArgumentParser(prog='mb')
74 subps = parser.add_subparsers() 74 subps = parser.add_subparsers()
75 75
76 subp = subps.add_parser('analyze', 76 subp = subps.add_parser('analyze',
77 help='analyze whether changes to a set of files ' 77 help='analyze whether changes to a set of files '
78 'will cause a set of binaries to be rebuilt.') 78 'will cause a set of binaries to be rebuilt.')
79 AddCommonOptions(subp) 79 AddCommonOptions(subp)
(...skipping 21 matching lines...) Expand all
101 subp.set_defaults(func=self.CmdGen) 101 subp.set_defaults(func=self.CmdGen)
102 102
103 subp = subps.add_parser('lookup', 103 subp = subps.add_parser('lookup',
104 help='look up the command for a given config or ' 104 help='look up the command for a given config or '
105 'builder') 105 'builder')
106 AddCommonOptions(subp) 106 AddCommonOptions(subp)
107 subp.set_defaults(func=self.CmdLookup) 107 subp.set_defaults(func=self.CmdLookup)
108 108
109 subp = subps.add_parser('validate', 109 subp = subps.add_parser('validate',
110 help='validate the config file') 110 help='validate the config file')
111 AddCommonOptions(subp) 111 subp.add_argument('-f', '--config-file', metavar='PATH',
112 default=self.default_config,
113 help='path to config file '
114 '(default is //tools/mb/mb_config.pyl)')
M-A Ruel 2015/07/17 01:17:13 default is %default ?
Dirk Pranke 2015/07/17 01:22:48 We don't want that because the actual default is a
M-A Ruel 2015/07/17 01:25:27 ok!
115 subp.add_argument('-q', '--quiet', action='store_true',
116 help='Do not print anything on success, '
117 'just return an exit code.')
112 subp.set_defaults(func=self.CmdValidate) 118 subp.set_defaults(func=self.CmdValidate)
113 119
114 subp = subps.add_parser('help', 120 subp = subps.add_parser('help',
115 help='Get help on a subcommand.') 121 help='Get help on a subcommand.')
116 subp.add_argument(nargs='?', action='store', dest='subcommand', 122 subp.add_argument(nargs='?', action='store', dest='subcommand',
117 help='The command to get help for.') 123 help='The command to get help for.')
118 subp.set_defaults(func=self.CmdHelp) 124 subp.set_defaults(func=self.CmdHelp)
119 125
120 self.args = parser.parse_args(argv) 126 self.args = parser.parse_args(argv)
121 127
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 738
733 if __name__ == '__main__': 739 if __name__ == '__main__':
734 try: 740 try:
735 sys.exit(main(sys.argv[1:])) 741 sys.exit(main(sys.argv[1:]))
736 except MBErr as e: 742 except MBErr as e:
737 print(e) 743 print(e)
738 sys.exit(1) 744 sys.exit(1)
739 except KeyboardInterrupt: 745 except KeyboardInterrupt:
740 print("interrupted, exiting", stream=sys.stderr) 746 print("interrupted, exiting", stream=sys.stderr)
741 sys.exit(130) 747 sys.exit(130)
OLDNEW
« no previous file with comments | « tools/mb/docs/user_guide.md ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698