changeset 47:879ec681f7e3 draft

Add --compile option.
author David Barts <n5jrn@me.com>
date Thu, 30 May 2019 20:14:14 -0700
parents 997d0c8c174f
children f89b560b7278
files launch
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)