File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ def validate(text, columns):
5757
5858p = argparse .ArgumentParser ()
5959p .add_argument ("-d" , "--directory" , help = "directory of clang-format" )
60+ p .add_argument ("-o" , "--output" , help = "path of output file" )
6061opts = p .parse_args ()
6162
6263binary = "clang-format"
@@ -66,10 +67,10 @@ def validate(text, columns):
6667help_text = get_help_text ()
6768validate (help_text , 100 )
6869
69- with open (DOC_FILE ) as f :
70+ with open (DOC_FILE , encoding = "utf-8" ) as f :
7071 contents = f .read ()
7172
7273contents = substitute (contents , "FORMAT_HELP" , help_text )
7374
74- with open (DOC_FILE , "wb" ) as output :
75+ with open (opts . output if opts . output else DOC_FILE , "wb" ) as output :
7576 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
2- // RUN: diff %t %S/../../docs/ClangFormatStyleOptions.rst
1+ // RUN: %python %S/../../docs/tools/dump_format_style.py %t.style
2+ // RUN: diff %t.style %S/../../docs/ClangFormatStyleOptions.rst
3+
4+ // RUN: %python %S/../../docs/tools/dump_format_help.py -o %t.help
5+ // RUN: diff %t.help %S/../../docs/ClangFormat.rst
You can’t perform that action at this time.
0 commit comments