 _ = require 'lodash'
 assert = require 'assert'
-readline = require 'readline'
+{ clearLine, cursorTo } = require 'readline'
 
 styler = require './styler'
 { verbose } = require './cli'
 
 module.exports = @
 
+# Alias
+{ stdout, stderr, exit } = process
+
 # Constants
 [INFO,WARN,ERROR,VERBOSE] = TAGS = ["INFO", "WARN", "ERROR", "VERBS"]
 LEFT_MARGIN = _.maxBy(TAGS, _.size).length + 1
 TAG_INDICATOR = ': '
 LEFT_PADSTRING_LONG_LINES = _.repeat(" ", LEFT_MARGIN + TAG_INDICATOR.length)
-MAX_COLS_PER_LINE = Math.max 10, process.stdout.columns - LEFT_PADSTRING_LONG_LINES.length - 1
+MAX_COLS_PER_LINE = Math.max 10, stdout.columns - LEFT_PADSTRING_LONG_LINES.length - 1
 
 # Private methods
 tag = (txt, style) -> style(_.padEnd(txt, LEFT_MARGIN)) + TAG_INDICATOR

        else # Quite strange there's no space in 70 character string...
            cutString[...-1] + "-\n" + LEFT_PADSTRING_LONG_LINES + fold(str[cols-1..])

createWriter = (txt, styler, stream = process.stdout) => (msg, endline = on) =>
        msg += "\n" if endline is on
        stream.write tag(txt, styler) + fold(msg)
        @

    .updateInfo("My name is joan")
    .endLine()

stdout.write "Shouldn't appear"; @eraseLine()

@error("This ends with error code 2", true, 2)
@info("Should'nt be printed")
