feat(cli): allow to pass command line arguments to function

This commit is contained in:
jakob.scheid committed 2026-09-10 09:58:18 +02:00
1 parent a8513a78e2
commit 60a097f0cc
1 file changed
+2 -2
+2 -2
View File
@@ -35,7 +35,7 @@ def existing_directory(path: str) -> pathlib.Path:
raise argparse.ArgumentTypeError(f'{_path}: not a directory') raise argparse.ArgumentTypeError(f'{_path}: not a directory')
return path return path
def main() -> int: def main(argv = None) -> int:
common_parser = argparse.ArgumentParser(add_help = False) common_parser = argparse.ArgumentParser(add_help = False)
common_parser.add_argument( common_parser.add_argument(
'project_directory', 'project_directory',
@@ -88,7 +88,7 @@ def main() -> int:
help = 'indicates whether Markdown tables are allowed in the documentation. By default, Markdown tables are disabled. Warning: Markdown tables are not CommonMark.' help = 'indicates whether Markdown tables are allowed in the documentation. By default, Markdown tables are disabled. Warning: Markdown tables are not CommonMark.'
) )
args = argument_parser.parse_args() args = argument_parser.parse_args(argv)
if args.output_dir is None: if args.output_dir is None:
args.output_dir = args.project_directory / 'docs/reference' args.output_dir = args.project_directory / 'docs/reference'