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():
187187 "parameter is a directory, the fixes of each compilation unit are "
188188 "stored in individual yaml files in the directory." ,
189189 )
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+ )
190199 parser .add_argument (
191200 "-extra-arg" ,
192201 dest = "extra_arg" ,
@@ -270,7 +279,12 @@ def main():
270279 ):
271280 os .makedirs (args .export_fixes )
272281
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+
274288 combine_fixes = True
275289
276290 if os .path .isdir (args .export_fixes ):
Original file line number Diff line number Diff line change @@ -315,6 +315,15 @@ def main():
315315 "parameter is a directory, the fixes of each compilation unit are "
316316 "stored in individual yaml files in the directory." ,
317317 )
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+ )
318327 parser .add_argument (
319328 "-j" ,
320329 type = int ,
@@ -401,7 +410,12 @@ def main():
401410 ):
402411 os .makedirs (args .export_fixes )
403412
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+
405419 combine_fixes = True
406420
407421 if os .path .isdir (args .export_fixes ):
You can’t perform that action at this time.
0 commit comments