File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,15 @@ def main():
187
187
"parameter is a directory, the fixes of each compilation unit are "
188
188
"stored in individual yaml files in the directory." ,
189
189
)
190
+ else :
191
+ parser .add_argument (
192
+ "-export-fixes" ,
193
+ metavar = "DIRECTORY" ,
194
+ dest = "export_fixes" ,
195
+ help = "A directory to store suggested fixes in, which can be applied "
196
+ "with clang-apply-replacements. The fixes of each compilation unit are "
197
+ "stored in individual yaml files in the directory." ,
198
+ )
190
199
parser .add_argument (
191
200
"-extra-arg" ,
192
201
dest = "extra_arg" ,
@@ -270,7 +279,12 @@ def main():
270
279
):
271
280
os .makedirs (args .export_fixes )
272
281
273
- if not os .path .isdir (args .export_fixes ) and yaml :
282
+ if not os .path .isdir (args .export_fixes ):
283
+ if not yaml :
284
+ raise RuntimeError (
285
+ "Cannot combine fixes in one yaml file. Either install PyYAML or specify an output directory."
286
+ )
287
+
274
288
combine_fixes = True
275
289
276
290
if os .path .isdir (args .export_fixes ):
Original file line number Diff line number Diff line change @@ -315,6 +315,15 @@ def main():
315
315
"parameter is a directory, the fixes of each compilation unit are "
316
316
"stored in individual yaml files in the directory." ,
317
317
)
318
+ else :
319
+ parser .add_argument (
320
+ "-export-fixes" ,
321
+ metavar = "directory" ,
322
+ dest = "export_fixes" ,
323
+ help = "A directory to store suggested fixes in, which can be applied "
324
+ "with clang-apply-replacements. The fixes of each compilation unit are "
325
+ "stored in individual yaml files in the directory." ,
326
+ )
318
327
parser .add_argument (
319
328
"-j" ,
320
329
type = int ,
@@ -401,7 +410,12 @@ def main():
401
410
):
402
411
os .makedirs (args .export_fixes )
403
412
404
- if not os .path .isdir (args .export_fixes ) and yaml :
413
+ if not os .path .isdir (args .export_fixes ):
414
+ if not yaml :
415
+ raise RuntimeError (
416
+ "Cannot combine fixes in one yaml file. Either install PyYAML or specify an output directory."
417
+ )
418
+
405
419
combine_fixes = True
406
420
407
421
if os .path .isdir (args .export_fixes ):
You can’t perform that action at this time.
0 commit comments