diff --git a/lib/command_line.js b/lib/command_line.js index b239a9de..41787a99 100644 --- a/lib/command_line.js +++ b/lib/command_line.js @@ -78,10 +78,10 @@ js = coffee.compile(code, o); if (opts.run) { return eval(js); - } else if (opts.print) { - return puts(js); } else if (opts.lint) { return lint(js); + } else if (opts.print || opts.eval) { + return puts(js); } else { return write_js(source, js); } diff --git a/src/command_line.coffee b/src/command_line.coffee index dc0cc66f..721411d7 100644 --- a/src/command_line.coffee +++ b/src/command_line.coffee @@ -73,9 +73,9 @@ compile_script: (source, code) -> else if opts.tree then puts coffee.tree(code).toString() else js: coffee.compile code, o - if opts.run then eval js - else if opts.print then puts js - else if opts.lint then lint js + if opts.run then eval js + else if opts.lint then lint js + else if opts.print or opts.eval then puts js else write_js source, js catch err if opts.watch then puts err.message else throw err