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 33# documentation in ../ClangFormatStyleOptions.rst automatically.
44# Run from the directory in which this file is located to update the docs.
55
6+ import argparse
67import inspect
78import os
89import re
@@ -474,6 +475,10 @@ class State:
474475 return options
475476
476477
478+ p = argparse .ArgumentParser ()
479+ p .add_argument ("-o" , "--output" , help = "path of output file" )
480+ args = p .parse_args ()
481+
477482with open (FORMAT_STYLE_FILE ) as f :
478483 opts = OptionsReader (f ).read_options ()
479484with open (INCLUDE_STYLE_FILE ) as f :
@@ -487,6 +492,5 @@ class State:
487492
488493contents = substitute (contents , "FORMAT_STYLE_OPTIONS" , options_text )
489494
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 :
492496 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
22// RUN: diff %t.style %S/../../docs/ClangFormatStyleOptions.rst
33
44// RUN: %python %S/../../docs/tools/dump_format_help.py -o %t.help
You can’t perform that action at this time.
0 commit comments