[pypy-svn] r32877 - pypy/dist/pypy/bin
fijal at codespeak.net
fijal at codespeak.net
Wed Oct 4 16:31:37 CEST 2006
Author: fijal
Date: Wed Oct 4 16:31:25 2006
New Revision: 32877
Modified:
pypy/dist/pypy/bin/jscompile.py
Log:
Fixed options (-o conflicts)
Modified: pypy/dist/pypy/bin/jscompile.py
==============================================================================
--- pypy/dist/pypy/bin/jscompile.py (original)
+++ pypy/dist/pypy/bin/jscompile.py Wed Oct 4 16:31:25 2006
@@ -1,9 +1,9 @@
#!/usr/bin/env python
""" RPython to javascript compiler
-Usage: jscompiler module_to_compile [list of functions to export]
+Usage: jscompile module_to_compile [list of functions to export]
- or -
-jscompiler --help to show list of options
+jscompile --help to show list of options
"""
import autopath
@@ -17,27 +17,30 @@
def get_options():
options = []
+ config, parser = option.get_standard_options()
options.append(make_option(
'--view', action='store_true', dest='view',
help='View flow graphs'))
options.append(make_option(
- '-o', '--output', action='store', type='string', dest='output',
+ '--output', action='store', type='string', dest='output',
help='File to save results (default output.js)'))
options.append(make_option(
'-d', '--debug', action='store_true', dest='debug_transform',
help="Use !EXPERIMENTAL! debug transform to produce tracebacks"
))
-
- return options
+
+ parser.add_options(options)
+ return config, parser
def process_options(argv):
- return option.process_options(get_options(), Options, argv)
+ config, parser = get_options()
+ return option.process_options(parser, Options, argv[1:])
if __name__ == '__main__':
- argv = process_options(sys.argv[1:])
+ argv = process_options(sys.argv)
curdir = os.getcwd()
if curdir not in sys.path:
sys.path.insert(0, curdir)
More information about the Pypy-commit
mailing list