MCPcopy Index your code
hub / github.com/nodejs/node / Main

Function Main

deps/v8/tools/torque/format-torque.py:197–225  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

195 print(' merely indicate which files need formatting')
196
197def Main():
198 if len(sys.argv) < 3:
199 print("error: at least 2 arguments required")
200 print_usage();
201 sys.exit(-1)
202
203 def is_option(arg):
204 return arg in ['-i', '-l', '-il']
205
206 should_format = lint = False
207
208 flag, files = sys.argv[1], sys.argv[2:]
209 if is_option(flag):
210 if '-i' == flag:
211 should_format = True
212 elif '-l' == flag:
213 lint = True
214 else:
215 lint = True
216 should_format = True
217 else:
218 print("error: -i and/or -l flags must be specified")
219 print_usage();
220 sys.exit(-1);
221
222 for filename in files:
223 process(filename, lint, should_format)
224
225 return 0
226
227if __name__ == '__main__':
228 sys.exit(Main());

Callers 1

format-torque.pyFile · 0.70

Calls 5

is_optionFunction · 0.85
processFunction · 0.85
print_usageFunction · 0.70
printFunction · 0.50
exitMethod · 0.45

Tested by

no test coverage detected