lms.cli.lib.version

Get the version of the LMS Toolkit package.

usage: python3 -m lms.cli.lib.version [-h] [--version]

Get the version of the LMS Toolkit package.

options:
  -h, --help  show this help message and exit
  --version   show program's version number and exit
 1"""
 2Get the version of the LMS Toolkit package.
 3"""
 4
 5import argparse
 6import sys
 7
 8import lms
 9import lms.cli.parser
10
11def run_cli(args: argparse.Namespace) -> int:
12    """ Run the CLI. """
13
14    print(f"v{lms.__version__}")
15    return 0
16
17def main() -> int:
18    """ Get a parser, parse the args, and call run. """
19    args, _ = _get_parser().parse_known_args()
20    return run_cli(args)
21
22def _get_parser() -> argparse.ArgumentParser:
23    """ Get the parser. """
24
25    return lms.cli.parser.get_parser(__doc__.strip(),
26            include_server = False,
27            include_auth = False,
28    )
29
30if (__name__ == '__main__'):
31    sys.exit(main())
def run_cli(args: argparse.Namespace) -> int:
12def run_cli(args: argparse.Namespace) -> int:
13    """ Run the CLI. """
14
15    print(f"v{lms.__version__}")
16    return 0

Run the CLI.

def main() -> int:
18def main() -> int:
19    """ Get a parser, parse the args, and call run. """
20    args, _ = _get_parser().parse_known_args()
21    return run_cli(args)

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