edq.cli.doc.update-pdoc-cli

Insert CLI documentation into built pdoc HTML documentation.

usage: python3 -m edq.cli.doc.update-pdoc-cli [-h]
                                              PYTHON_PACKAGE
                                              PYTHON_QUALIFIED_NAME
                                              HTML_DOCS_DIR

Insert CLI documentation into built pdoc HTML documentation.

positional arguments:
  PYTHON_PACKAGE        The package to search for CLI files, e.g., "edq/cli".
  PYTHON_QUALIFIED_NAME
                        The qualified name to append to all python objects to
                        recover their fully qualified name, e.g., "edq.cli".
  HTML_DOCS_DIR         The directory containing already build pdoc
                        documentation.

options:
  -h, --help            show this help message and exit
 1# pylint: disable=invalid-name
 2
 3"""
 4Insert CLI documentation into built pdoc HTML documentation.
 5"""
 6
 7import argparse
 8import sys
 9
10import edq.clilib.pdoc
11import edq.core.argparser
12
13def run_cli(args: argparse.Namespace) -> int:
14    """ Run the CLI. """
15
16    edq.clilib.pdoc.update_pdoc(args.python_package, args.base_qualified_name, args.html_dir)
17
18    return 0
19
20def main() -> int:
21    """ Get a parser, parse the args, and call run. """
22
23    return run_cli(_get_parser().parse_args())
24
25def _get_parser() -> argparse.ArgumentParser:
26    """ Get a parser and add addition flags. """
27
28    parser = edq.core.argparser.get_default_parser(__doc__.strip())
29
30    parser.add_argument('python_package', metavar = 'PYTHON_PACKAGE',
31        action = 'store', type = str,
32        help = 'The package to search for CLI files, e.g., "edq/cli".',
33    )
34
35    parser.add_argument('base_qualified_name', metavar = 'PYTHON_QUALIFIED_NAME',
36        action = 'store', type = str,
37        help = 'The qualified name to append to all python objects to recover their fully qualified name, e.g., "edq.cli".',
38    )
39
40    parser.add_argument('html_dir', metavar = 'HTML_DOCS_DIR',
41        action = 'store', type = str,
42        help = 'The directory containing already build pdoc documentation.',
43    )
44
45    return parser
46
47if (__name__ == '__main__'):
48    sys.exit(main())
def run_cli(args: argparse.Namespace) -> int:
14def run_cli(args: argparse.Namespace) -> int:
15    """ Run the CLI. """
16
17    edq.clilib.pdoc.update_pdoc(args.python_package, args.base_qualified_name, args.html_dir)
18
19    return 0

Run the CLI.

def main() -> int:
21def main() -> int:
22    """ Get a parser, parse the args, and call run. """
23
24    return run_cli(_get_parser().parse_args())

Get a parser, parse the args, and call run.