 
 
 class PreferCommandLineInterface
-  constructor: (@configurator) ->
+  constructor: (@identifier, @configurator) ->
     sourceText = chalk.white configurator.options.results.source
     winston.debug 'Using ' + sourceText
 

    {argv} = yargs

    configurationFileName = _.first argv._
    # winston.debug 'Loading ' + chalk.white configurationFileName

    prefer.load configurationFileName, (err, configurator) ->
      throw err if err?
      new PreferCommandLineInterface configurator


module.exports.main = PreferCommandLineInterface.main


    for key in keys
      value = model[key]
      typeText = chalk.blue typeof value

      if _.isObject value
        valueText = ''
      else
        valueText = chalk.magenta value.toString()

      nameText = chalk.white key

      window.add "#{ nameText } = [#{ typeText }] #{ valueText }"

    window.key 't', @backToTop
    window.key 'h', @back
    window.on 'select', @selected keys, model

    window.focus()
    screen.render()

  clean: ->
    window.detach() while window = @windows.pop() if @windows?
    @header.detach() if @header?

  createHeader: ->
    @header?.detach()
    return unless screen.height > 15

    content = """

      identifier: #{ chalk.white @identifier }
      location: #{ chalk.magenta @configurator.options.results.source }

    """

    @header = blessed.box
      top: 0
      left: 5
      height: 4

    @header.setContent content
    screen.append @header

  initialize: (@configuration) ->
    @clean()

    @stack = []
    @windows = []

    @createHeader()
    @render()

  @main: ->
