# HG changeset patch # User David Barts # Date 1559272454 25200 # Node ID 879ec681f7e38cb268dd173878440bbfb93b75bc # Parent 997d0c8c174fde66fcb0d995aa6dc043328fa613 Add --compile option. diff -r 997d0c8c174f -r 879ec681f7e3 launch --- a/launch Thu May 30 16:36:43 2019 -0700 +++ b/launch Thu May 30 20:14:14 2019 -0700 @@ -19,6 +19,7 @@ parser = ArgumentParser(prog=sys.argv[0], usage="%(prog)s [options] [directory [path]]") opt = parser.add_argument opt("-b", "--bind", default="localhost", help="address to bind to (default: localhost)") +opt("-c", "--compile", action="store_true", help="compile .py files only; do not run a server") opt("-d", "--debug", action="store_true", help="enable debug mode") opt("-e", "--encoding", default=ENCODING, help="encoding to use (default {0})".format(ENCODING)) opt("-f", "--force", action="store_true", help="do not abort on errors") @@ -37,4 +38,6 @@ sys.stderr.write("{0}: {1} error{2} detected, {3}\n".format( MYNAME, errors, "" if errors == 1 else "s", action)) if not args.force: sys.exit(1) -app.run(host=args.bind, port=args.port) + +if not args.compile: + app.run(host=args.bind, port=args.port)