@@ -10,6 +10,7 @@ from __future__ import print_function
import sys
import py_compile
import compileall
+import argparse
class ReportProblem:
def __nonzero__(self):
@@ -21,4 +22,12 @@ class ReportProblem:
report_problem = ReportProblem()
-compileall.compile_dir(sys.argv[1], quiet=report_problem)
+parser = argparse.ArgumentParser(description='Compile Python source files in a directory tree.')
+parser.add_argument("target", metavar='DIRECTORY',
+ help='Directory to scan')
+parser.add_argument("--force", action='store_true',
+ help="Force compilation even if alread compiled")
+
+args = parser.parse_args()
+
+compileall.compile_dir(args.target, force=args.force, quiet=report_problem)
Signed-off-by: Jérôme Pouiller <jezz@sysmic.org> --- support/scripts/pycompile.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)