Skip to content

Commit 4fae862

Browse files
committed
Clarify argument names of the script generating the docs
1 parent c9ade00 commit 4fae862

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

clang/docs/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,10 @@ if (LLVM_ENABLE_SPHINX)
151151
set(aopts_rst_in "${CMAKE_CURRENT_SOURCE_DIR}/${aopts_rst_rel_path}.in")
152152
add_custom_command(
153153
OUTPUT ${aopts_rst}
154-
COMMAND ${Python3_EXECUTABLE} generate_analyzer_options_docs.py -i ${analyzeroptions_def} -t ${aopts_rst_in} -o ${aopts_rst}
154+
COMMAND ${Python3_EXECUTABLE} generate_analyzer_options_docs.py
155+
--options-def "${analyzeroptions_def}"
156+
--template "${aopts_rst_in}"
157+
--out "${aopts_rst}"
155158
WORKING_DIRECTORY ${docs_tools_dir}
156159
VERBATIM
157160
COMMENT "Generating ${aopts_rst}"

clang/docs/tools/generate_analyzer_options_docs.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,17 +226,17 @@ def get_option_list(input_file):
226226

227227

228228
p = argparse.ArgumentParser()
229-
p.add_argument("-i", "--input", help="path to AnalyzerOptions.def")
230-
p.add_argument("-t", "--template", help="path of template file")
231-
p.add_argument("-o", "--output", help="path of output file")
229+
p.add_argument("--options-def", help="path to AnalyzerOptions.def")
230+
p.add_argument("--template", help="path of template file")
231+
p.add_argument("--out", help="path of output file")
232232
opts = p.parse_args()
233233

234234
with open(opts.template, encoding="utf-8") as f:
235235
doc_template = f.read()
236236

237237
PLACEHOLDER = ".. OPTIONS_LIST_PLACEHOLDER\n"
238238

239-
rst_output = doc_template.replace(PLACEHOLDER, get_option_list(opts.input))
239+
rst_output = doc_template.replace(PLACEHOLDER, get_option_list(opts.options_def))
240240

241-
with open(opts.output, "w", newline="", encoding="utf-8") as f:
241+
with open(opts.out, "w", newline="", encoding="utf-8") as f:
242242
f.write(rst_output)

0 commit comments

Comments
 (0)