with a working -n --no-wrap option to disable the top-level function safety wrapper

This commit is contained in:
Jeremy Ashkenas
2009-12-24 15:31:00 -08:00
parent 46f81c2de1
commit e27756cee8
6 changed files with 48 additions and 9 deletions

View File

@@ -112,7 +112,7 @@ Usage:
# Compile a single source file to JavaScript.
def compile(script, source='')
begin
CoffeeScript.compile(script)
CoffeeScript.compile(script, :no_wrap => @options[:no_wrap])
rescue CoffeeScript::ParseError => e
STDERR.puts e.message(source)
exit(1) unless @options[:watch]
@@ -160,6 +160,9 @@ Usage:
opts.on('-v', '--verbose', 'print at every step of code generation') do |v|
ENV['VERBOSE'] = 'true'
end
opts.on('-n', '--no-wrap', 'suppress the top-level safety function wrapper') do |n|
@options[:no_wrap] = true
end
opts.on_tail('--install-bundle', 'install the CoffeeScript TextMate bundle') do |i|
install_bundle
exit