enabling the --eval option for the self-compiler

This commit is contained in:
Jeremy Ashkenas
2010-02-13 23:27:13 -05:00
parent c39c2e3599
commit 9de729e825
2 changed files with 7 additions and 5 deletions

View File

@@ -17,11 +17,9 @@ SWITCHES: [
['-w', '--watch', 'watch scripts for changes, and recompile']
['-p', '--print', 'print the compiled JavaScript to stdout']
['-l', '--lint', 'pipe the compiled JavaScript through JSLint']
['-e', '--eval', 'compile a cli scriptlet or read from stdin']
['-e', '--eval', 'compile a string from the command line']
['-t', '--tokens', 'print the tokens that the lexer produces']
[ '--tree', 'print the parse tree that Jison produces']
['-n', '--no-wrap', 'raw output, no function safety wrapper']
['-g', '--globals', 'attach all top-level variables as globals']
['-tr','--tree', 'print the parse tree that Jison produces']
['-v', '--version', 'display CoffeeScript version']
['-h', '--help', 'display this help message']
]
@@ -36,6 +34,7 @@ option_parser: null
exports.run: ->
parse_options()
return require './repl' if options.interactive
return puts coffee.compile sources[0] if options.eval
usage() unless sources.length
compile_scripts()
this