generated from jCloud/repository-template
feat(cli): allow to pass command line arguments to function
This commit is contained in:
1 file changed
+2
-2
@@ -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'
|
||||||
|
|||||||
Reference in new issue
Block a user