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 11 12def run_cli(args: argparse.Namespace) -> int: 13 """ Run the CLI. """ 14 15 print(f"v{lms.__version__}") 16 return 0 17 18def main() -> int: 19 """ Get a parser, parse the args, and call run. """ 20 21 args, _ = _get_parser().parse_known_args() 22 return run_cli(args) 23 24def _get_parser() -> argparse.ArgumentParser: 25 """ Get the parser. """ 26 27 return lms.cli.parser.get_parser(__doc__.strip(), 28 include_server = False, 29 include_auth = False, 30 ) 31 32if (__name__ == '__main__'): 33 sys.exit(main())
def
run_cli(args: argparse.Namespace) -> int:
13def run_cli(args: argparse.Namespace) -> int: 14 """ Run the CLI. """ 15 16 print(f"v{lms.__version__}") 17 return 0
Run the CLI.
def
main() -> int:
19def main() -> int: 20 """ Get a parser, parse the args, and call run. """ 21 22 args, _ = _get_parser().parse_known_args() 23 return run_cli(args)
Get a parser, parse the args, and call run.