109
111 (options, args) = parser.parse_args()
113 parser.print_help()
114 return 1
115
116
117 if args:
118 parser.print_help()
119 return 1
120
121
122 script_args = ["--ignore_unrecognized_flags"]
123
124 for flag in options.vm_flag:
125 script_args.append(flag)
126
127
128 if options.packages:
129 script_args.append(
''.
join([
"--packages=", options.packages]))
130
131
132 script_args.append(
''.
join([
"--snapshot_kind=", options.snapshot_kind]))
133 script_args.append(
''.
join([
"--vm_snapshot_data=", options.vm_output_bin]))
134 script_args.append(
''.
join(
135 ["--isolate_snapshot_data=", options.isolate_output_bin]))
136
137 if options.vm_instructions_output_bin != None:
138 script_args.append(
''.
join(
139 ["--vm_snapshot_instructions=",
140 options.vm_instructions_output_bin]))
141 if options.isolate_instructions_output_bin != None:
142 script_args.append(
''.
join([
143 "--isolate_snapshot_instructions=",
144 options.isolate_instructions_output_bin
145 ]))
146
147
148 if options.script:
149 script_args.append(options.script)
150
151
152 command = [options.executable] + script_args
153 try:
155 command,
156 outStream=sys.stderr,
157 errStream=sys.stderr,
158 verbose=options.verbose,
159 printErrorInfo=True)
160 except Exception as e:
161 return -1
162
163
165
166 return 0
167
168
def ProcessOptions(options)
def RunCommand(command, input=None, pollFn=None, outStream=None, errStream=None, killOnEarlyReturn=True, verbose=False, debug=False, printErrorInfo=False)
static SkString join(const CommandLineFlags::StringArray &)