GNUmakefile: update arguments for 'doc_man' target

Add '--verbose' argument to the script so the destination is printed.
Otherwise there is no hint to where the man page was written.
This commit is contained in:
Campbell Barton 2022-02-14 16:20:16 +11:00
parent 47b783bbe9
commit 31be5ce8b9
2 changed files with 15 additions and 3 deletions

View File

@ -560,7 +560,7 @@ doc_dna: .FORCE
@echo "docs written into: '$(BLENDER_DIR)/doc/blender_file_format/dna.html'"
doc_man: .FORCE
@$(PYTHON) doc/manpage/blender.1.py $(BLENDER_BIN) blender.1
@$(PYTHON) doc/manpage/blender.1.py --blender="$(BLENDER_BIN)" --output=blender.1 --verbose
help_features: .FORCE
@$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_print_build_options.py" $(BLENDER_DIR)"/CMakeLists.txt"

View File

@ -79,7 +79,9 @@ def blender_extract_info(blender_bin: str) -> Dict[str, str]:
}
def man_page_from_blender_help(fh: TextIO, blender_bin: str) -> None:
def man_page_from_blender_help(fh: TextIO, blender_bin: str, verbose: bool) -> None:
if verbose:
print("Extracting help text:", blender_bin)
blender_info = blender_extract_info(blender_bin)
# Header Content.
@ -178,6 +180,13 @@ def create_argparse() -> argparse.ArgumentParser:
required=True,
help="Path to the blender binary."
)
parser.add_argument(
"--verbose",
default=False,
required=False,
action='store_true',
help="Print additional progress."
)
return parser
@ -188,9 +197,12 @@ def main() -> None:
blender_bin = args.blender
output_filename = args.output
verbose = args.verbose
with open(output_filename, "w", encoding="utf-8") as fh:
man_page_from_blender_help(fh, blender_bin)
man_page_from_blender_help(fh, blender_bin, verbose)
if verbose:
print("Written:", output_filename)
if __name__ == "__main__":