MCPcopy Create free account
hub / github.com/nodejs/node / ParseArgs

Method ParseArgs

deps/v8/tools/mb/mb.py:113–281  ·  view source on GitHub ↗
(self, argv)

Source from the content-addressed store, hash-verified

111 return 1
112
113 def ParseArgs(self, argv):
114 def AddCommonOptions(subp):
115 subp.add_argument('-b', '--builder',
116 help='builder name to look up config from')
117 subp.add_argument(
118 '-m', '--builder-group',
119 help='builder group name to look up config from')
120 subp.add_argument('-c', '--config',
121 help='configuration to analyze')
122 subp.add_argument('--phase',
123 help='optional phase name (used when builders '
124 'do multiple compiles with different '
125 'arguments in a single build)')
126 subp.add_argument('-f', '--config-file', metavar='PATH',
127 default=self.default_config,
128 help='path to config file '
129 '(default is %(default)s)')
130 subp.add_argument(
131 '-i',
132 '--isolate-map-file',
133 metavar='PATH',
134 help='path to isolate map file '
135 '(default is %(default)s)',
136 default=[],
137 action='append',
138 dest='isolate_map_files')
139 subp.add_argument(
140 '--android-version-code',
141 help='Sets GN arg android_default_version_code')
142 subp.add_argument('--android-version-name',
143 help='Sets GN arg android_default_version_name')
144 subp.add_argument('-n', '--dryrun', action='store_true',
145 help='Do a dry run (i.e., do nothing, just print '
146 'the commands that will run)')
147 subp.add_argument('-v', '--verbose', action='store_true',
148 help='verbose logging')
149
150 parser = argparse.ArgumentParser(prog='mb')
151 subps = parser.add_subparsers()
152
153 subp = subps.add_parser('analyze',
154 help='analyze whether changes to a set of files '
155 'will cause a set of binaries to be rebuilt.')
156 AddCommonOptions(subp)
157 subp.add_argument('path', nargs=1,
158 help='path build was generated into.')
159 subp.add_argument('input_path', nargs=1,
160 help='path to a file containing the input arguments '
161 'as a JSON object.')
162 subp.add_argument('output_path', nargs=1,
163 help='path to a file containing the output arguments '
164 'as a JSON object.')
165 subp.add_argument('--json-output',
166 help='Write errors to json.output')
167 subp.set_defaults(func=self.CmdAnalyze)
168
169 subp = subps.add_parser('export',
170 help='print out the expanded configuration for'

Callers 3

MainMethod · 0.95
CmdHelpMethod · 0.95
mainMethod · 0.80

Calls 2

add_argumentMethod · 0.45
parse_argsMethod · 0.45

Tested by

no test coverage detected