luxos.api.cli#
Luxos comes with a convenient cli interface generator, similar to what click provides, but simplified for easier usage. It uses argparse so no external package is needed.
This is the simplest script:
# script.py
#!/usr/bin/env python3
import logging
import luxos.cli.v1 as cli
log = logging.getLogger(__name__)
@cli.cli()
def main():
log.debug("Hello debug")
log.info("Hello info")
log.warning("Hello warning")
if __name__ == "__main__"
main()
This script takes -v|--verbose
and -q|--quiet
flags, controlling the logging
output.
Starting#
The best way to familiarize with it is to following simple examples:
simple script One
second