       process.exit 1
 
     _.each files, (fname) -> work fname
+
+  else
+    # Something was piped or redirected into stdin; use that instead of filenames.
+    work '/dev/stdin'
 
 module.exports =
   run: (args...) ->

  files = process.argv.slice(2)
  work  = proc or build_and_show

  try
    work '/dev/stdin'

  catch e
    throw e unless e.code == 'EAGAIN'

    if files.length == 0
      console.warn "Usage:"
      console.warn "  #{cmd} file.js"

_    = require('underscore')
fs   = require('fs')
path = require('path')
tty  = require('tty')

UnsupportedError = js2coffee.UnsupportedError

