Skip to content

cli ¤

Module that contains the command line application.

Modules:

  • debug

    Debugging utilities.

Functions:

  • get_parser

    Return the CLI argument parser.

  • main

    Run the main program.

get_parser ¤

get_parser() -> ArgumentParser

Return the CLI argument parser.

Returns:

Source code in src/griffe_typedoc/cli.py
32
33
34
35
36
37
38
39
40
41
def get_parser() -> argparse.ArgumentParser:
    """Return the CLI argument parser.

    Returns:
        An argparse parser.
    """
    parser = argparse.ArgumentParser(prog="griffe-typedoc")
    parser.add_argument("-V", "--version", action="version", version=f"%(prog)s {debug.get_version()}")
    parser.add_argument("--debug-info", action=_DebugInfo, help="Print debug information.")
    return parser

main ¤

main(args: list[str] | None = None) -> int

Run the main program.

This function is executed when you type griffe-typedoc or python -m griffe_typedoc.

Parameters:

  • args (list[str] | None, default: None ) –

    Arguments passed from the command line.

Returns:

  • int

    An exit code.

Source code in src/griffe_typedoc/cli.py
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
def main(args: list[str] | None = None) -> int:
    """Run the main program.

    This function is executed when you type `griffe-typedoc` or `python -m griffe_typedoc`.

    Parameters:
        args: Arguments passed from the command line.

    Returns:
        An exit code.
    """
    parser = get_parser()
    opts = parser.parse_args(args=args)
    print(opts)
    return 0