File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 3
3
# documentation in ../ClangFormatStyleOptions.rst automatically.
4
4
# Run from the directory in which this file is located to update the docs.
5
5
6
+ import argparse
6
7
import inspect
7
8
import os
8
9
import re
@@ -474,6 +475,10 @@ class State:
474
475
return options
475
476
476
477
478
+ p = argparse .ArgumentParser ()
479
+ p .add_argument ("-o" , "--output" , help = "path of output file" )
480
+ args = p .parse_args ()
481
+
477
482
with open (FORMAT_STYLE_FILE ) as f :
478
483
opts = OptionsReader (f ).read_options ()
479
484
with open (INCLUDE_STYLE_FILE ) as f :
@@ -487,6 +492,5 @@ class State:
487
492
488
493
contents = substitute (contents , "FORMAT_STYLE_OPTIONS" , options_text )
489
494
490
- output_file_path = sys .argv [1 ] if len (sys .argv ) == 2 else DOC_FILE
491
- with open (output_file_path , "wb" ) as output :
495
+ with open (args .output if args .output else DOC_FILE , "wb" ) as output :
492
496
output .write (contents .encode ())
Original file line number Diff line number Diff line change 1
- // RUN: %python %S/../../docs/tools/dump_format_style.py %t.style
1
+ // RUN: %python %S/../../docs/tools/dump_format_style.py -o %t.style
2
2
// RUN: diff %t.style %S/../../docs/ClangFormatStyleOptions.rst
3
3
4
4
// RUN: %python %S/../../docs/tools/dump_format_help.py -o %t.help
You can’t perform that action at this time.
0 commit comments